summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2018-07-01 17:22:56 +0200
committerSebastian Reichel <sre@ring0.de>2018-07-15 22:59:57 +0200
commite821aca14ee3c59380c82e32c9cfcdbcca144a96 (patch)
tree7c9f36a5049590395cce6e0c6721f43faf99dab2
parent98dda4beafd082b96c6dc8b3f44e1589a39069c1 (diff)
downloadserial-barcode-scanner-e821aca14ee3c59380c82e32c9cfcdbcca144a96.tar.bz2
all: fix all remaining warnings
-rw-r--r--data/po/de.po16
-rw-r--r--data/po/shopsystem.pot16
-rw-r--r--src/mail/mailer.vala12
-rw-r--r--src/pdf-invoice/test.vala24
4 files changed, 50 insertions, 18 deletions
diff --git a/data/po/de.po b/data/po/de.po
index 9196b50..49b85e8 100644
--- a/data/po/de.po
+++ b/data/po/de.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: shopsystem 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-06-29 21:19+0200\n"
+"POT-Creation-Date: 2018-07-01 17:19+0200\n"
"PO-Revision-Date: 2018-06-28 21:14+0200\n"
"Last-Translator: Sebastian Reichel <sre@ring0.de>\n"
"Language-Team: German\n"
@@ -134,8 +134,8 @@ msgid "DBus Error: %s"
msgstr "DBus Fehler: %s"
#: audio/main.vala:42 curses-ui/main.vala:68 database/main.vala:31
-#: input-device/main.vala:33 pdf-invoice/main.vala:27 pgp/main.vala:31
-#: serial-device/main.vala:31 web/main.vala:52
+#: input-device/main.vala:33 pdf-invoice/main.vala:27 pdf-invoice/test.vala:58
+#: pgp/main.vala:31 serial-device/main.vala:31 web/main.vala:52
#, c-format
msgid "DBus Error: %s\n"
msgstr "DBus Fehler: %s\n"
@@ -209,7 +209,7 @@ msgstr "Datei '%s' existiert nicht.\n"
msgid "File Error: %s"
msgstr "Datei Fehler: %s"
-#: pdf-invoice/pdf-invoice.vala:387
+#: pdf-invoice/pdf-invoice.vala:387 pdf-invoice/test.vala:64
#, c-format
msgid "File Error: %s\n"
msgstr "Datei Fehler: %s\n"
@@ -224,7 +224,8 @@ msgid "IO Error: %s"
msgstr "EA Fehler: %s"
#: audio/main.vala:38 curses-ui/main.vala:66 database/main.vala:27
-#: input-device/main.vala:29 pdf-invoice/main.vala:29 pgp/main.vala:33
+#: input-device/main.vala:29 pdf-invoice/main.vala:29 pdf-invoice/test.vala:22
+#: pdf-invoice/test.vala:60 pgp/main.vala:33
#: scanner-session/scannersession.vala:49 serial-device/main.vala:27
#: web/main.vala:48
#, c-format
@@ -250,6 +251,11 @@ msgstr "Eingabegerät wird ignoriert\n"
msgid "Internal Error!"
msgstr "Interner Fehler!"
+#: pdf-invoice/test.vala:62
+#, fuzzy, c-format
+msgid "Invoice PDF Error: %s\n"
+msgstr "Datei Fehler: %s\n"
+
#: curses-ui/main.vala:70 web/main.vala:45 web/main.vala:50
#, c-format
msgid "KeyFile Error: %s\n"
diff --git a/data/po/shopsystem.pot b/data/po/shopsystem.pot
index 757f7a5..63da7dc 100644
--- a/data/po/shopsystem.pot
+++ b/data/po/shopsystem.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: shopsystem\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-06-29 21:19+0200\n"
+"POT-Creation-Date: 2018-07-01 17:19+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -135,8 +135,8 @@ msgid "DBus Error: %s"
msgstr ""
#: audio/main.vala:42 curses-ui/main.vala:68 database/main.vala:31
-#: input-device/main.vala:33 pdf-invoice/main.vala:27 pgp/main.vala:31
-#: serial-device/main.vala:31 web/main.vala:52
+#: input-device/main.vala:33 pdf-invoice/main.vala:27 pdf-invoice/test.vala:58
+#: pgp/main.vala:31 serial-device/main.vala:31 web/main.vala:52
#, c-format
msgid "DBus Error: %s\n"
msgstr ""
@@ -210,7 +210,7 @@ msgstr ""
msgid "File Error: %s"
msgstr ""
-#: pdf-invoice/pdf-invoice.vala:387
+#: pdf-invoice/pdf-invoice.vala:387 pdf-invoice/test.vala:64
#, c-format
msgid "File Error: %s\n"
msgstr ""
@@ -225,7 +225,8 @@ msgid "IO Error: %s"
msgstr ""
#: audio/main.vala:38 curses-ui/main.vala:66 database/main.vala:27
-#: input-device/main.vala:29 pdf-invoice/main.vala:29 pgp/main.vala:33
+#: input-device/main.vala:29 pdf-invoice/main.vala:29 pdf-invoice/test.vala:22
+#: pdf-invoice/test.vala:60 pgp/main.vala:33
#: scanner-session/scannersession.vala:49 serial-device/main.vala:27
#: web/main.vala:48
#, c-format
@@ -251,6 +252,11 @@ msgstr ""
msgid "Internal Error!"
msgstr ""
+#: pdf-invoice/test.vala:62
+#, c-format
+msgid "Invoice PDF Error: %s\n"
+msgstr ""
+
#: curses-ui/main.vala:70 web/main.vala:45 web/main.vala:50
#, c-format
msgid "KeyFile Error: %s\n"
diff --git a/src/mail/mailer.vala b/src/mail/mailer.vala
index 3d7a996..642ceaa 100644
--- a/src/mail/mailer.vala
+++ b/src/mail/mailer.vala
@@ -172,12 +172,16 @@ public class MailerImplementation {
message.set_reverse_path(current_mail.get_reverse_path());
int result = session.start_session();
- if(result == 0)
- throw new IOError.FAILED(_("eSMTP: Start Session failed!"));
+ if(result == 0) {
+ stderr.printf(_("eSMTP: Start Session failed!"));
+ return false;
+ }
unowned Smtp.Status status = message.transfer_status();
- if(status.code < 200 || status.code >= 300)
- throw new IOError.FAILED(_("Reply from SMTP-Server: %s"), status.text);
+ if(status.code < 200 || status.code >= 300) {
+ stderr.printf(_("Reply from SMTP-Server: %s"));
+ return false;
+ }
current_mail = null;
diff --git a/src/pdf-invoice/test.vala b/src/pdf-invoice/test.vala
index e55f3a3..5eb7f52 100644
--- a/src/pdf-invoice/test.vala
+++ b/src/pdf-invoice/test.vala
@@ -14,7 +14,13 @@
*/
public static int main(string args[]) {
- PDFInvoice invoice = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.InvoicePDF", "/io/mainframe/shopsystem/invoicepdf");
+ PDFInvoice invoice;
+
+ try {
+ invoice = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.InvoicePDF", "/io/mainframe/shopsystem/invoicepdf");
+ } catch(IOError e) {
+ error(_("IO Error: %s\n"), e.message);
+ }
InvoiceRecipient r = {
"Max",
@@ -43,10 +49,20 @@ public static int main(string args[]) {
invoice.invoice_entries = {e1};
/* generate pdf */
- var pdfdata = invoice.generate();
+ try {
+ var pdfdata = invoice.generate();
- /* write pdf into file */
- FileUtils.set_contents("test.pdf", (string) pdfdata, pdfdata.length);
+ /* write pdf into file */
+ FileUtils.set_contents("test.pdf", (string) pdfdata, pdfdata.length);
+ } catch(DBusError e) {
+ error(_("DBus Error: %s\n"), e.message);
+ } catch(IOError e) {
+ error(_("IO Error: %s\n"), e.message);
+ } catch(InvoicePDFError e) {
+ error(_("Invoice PDF Error: %s\n"), e.message);
+ } catch(FileError e) {
+ error(_("File Error: %s\n"), e.message);
+ }
return 0;
}