[moserial] add missing catch statments for exceptions
- From: Michael J. Chudobiak <mjc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [moserial] add missing catch statments for exceptions
- Date: Mon, 14 Feb 2011 14:53:29 +0000 (UTC)
commit 975a597327fcf312bc26b2b2bab5181f58952f49
Author: Marlo <brooss teambb gmail com>
Date: Mon Feb 14 09:52:46 2011 -0500
add missing catch statments for exceptions
src/MainWindow.vala | 21 ++++++++++++++++++---
src/Rzwrapper.vala | 10 ++++++++++
src/Szwrapper.vala | 9 +++++++++
3 files changed, 37 insertions(+), 3 deletions(-)
---
diff --git a/src/MainWindow.vala b/src/MainWindow.vala
index 45f41dc..2e60db2 100644
--- a/src/MainWindow.vala
+++ b/src/MainWindow.vala
@@ -306,7 +306,12 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
setWindowTitle(null);
profileChanged=false;
RecentManager recentManager = RecentManager.get_default ();
- recentManager.add_item(GLib.Filename.to_uri(filename));
+ try {
+ recentManager.add_item(GLib.Filename.to_uri(filename));
+ }
+ catch (GLib.ConvertError e) {
+ stdout.printf("%s\n", e.message);
+ }
}
}
@@ -328,7 +333,12 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
}
private void recentItemOpen(RecentChooser r) {
- applyProfile(GLib.Filename.from_uri(r.get_current_uri()));
+ try{
+ applyProfile(GLib.Filename.from_uri(r.get_current_uri()));
+ }
+ catch (GLib.ConvertError e) {
+ stdout.printf("%s\n", e.message);
+ }
}
private void insertBufferEnd (TextBuffer buf, string s) {
@@ -822,7 +832,12 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
profile.save(profileFilename, gtkWindow);
profileChanged=false;
RecentManager recentManager = RecentManager.get_default ();
- recentManager.add_item(GLib.Filename.to_uri(profileFilename));
+ try {
+ recentManager.add_item(GLib.Filename.to_uri(profileFilename));
+ }
+ catch (GLib.ConvertError e) {
+ stdout.printf("%s\n", e.message);
+ }
}
private void saveProfileAs () {
diff --git a/src/Rzwrapper.vala b/src/Rzwrapper.vala
index 7c81d7f..05530a8 100644
--- a/src/Rzwrapper.vala
+++ b/src/Rzwrapper.vala
@@ -98,6 +98,9 @@ public class moserial.Rzwrapper: GLib.Object
errorDialog.run();
errorDialog.destroy();
}
+ catch (GLib.IOChannelError e){
+ stdout.printf("readError() %s\n", e.message);
+ }
}
}
public void writeChar(uchar byte) {
@@ -152,6 +155,10 @@ public class moserial.Rzwrapper: GLib.Object
catch (ConvertError e) {
stdout.printf("readError() %s\n", e.message);
}
+ catch (GLib.IOChannelError e){
+ stdout.printf("readError() %s\n", e.message);
+ }
+
for (int x=0; x<bytesRead; x++) {
unichar c = m_buf[x];
if(c.isprint() || c.isspace())
@@ -216,6 +223,9 @@ public class moserial.Rzwrapper: GLib.Object
catch (ConvertError e) {
stdout.printf("readBytes() %s\n", e.message);
}
+ catch (GLib.IOChannelError e){
+ stdout.printf("readError() %s\n", e.message);
+ }
for (int x=0; x<bytesRead; x++) {
sc.sendByte(m_buf[x]);
//sendByte(m_buf[x]);
diff --git a/src/Szwrapper.vala b/src/Szwrapper.vala
index b9ff80c..7106336 100644
--- a/src/Szwrapper.vala
+++ b/src/Szwrapper.vala
@@ -103,6 +103,9 @@ public class moserial.Szwrapper: GLib.Object
errorDialog.run();
errorDialog.destroy();
}
+ catch (GLib.IOChannelError e){
+ stdout.printf("readError() %s\n", e.message);
+ }
}
}
public void writeChar(uchar byte) {
@@ -145,6 +148,9 @@ public class moserial.Szwrapper: GLib.Object
catch (ConvertError e) {
stdout.printf("%s\n", e.message);
}
+ catch (GLib.IOChannelError e){
+ stdout.printf("readError() %s\n", e.message);
+ }
for (int x=0; x<bytesRead; x++) {
unichar c = m_buf[x];
if(c.isprint() || c.isspace())
@@ -215,6 +221,9 @@ public class moserial.Szwrapper: GLib.Object
catch (ConvertError e) {
stdout.printf("%s\n", e.message);
}
+ catch (GLib.IOChannelError e){
+ stdout.printf("readError() %s\n", e.message);
+ }
sc.sendBytes(m_buf, bytesRead);
return true;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]