[gxml] Error.vala: Add GXml.Error errordomain, for actual exception handling unlike DomExceptions
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Error.vala: Add GXml.Error errordomain, for actual exception handling unlike DomExceptions
- Date: Mon, 14 Oct 2013 08:37:17 +0000 (UTC)
commit 002b873c2f38004ba6323c08fc2607930ce71953
Author: Richard Schwarting <aquarichy gmail com>
Date: Wed Oct 2 10:05:37 2013 -0400
Error.vala: Add GXml.Error errordomain, for actual exception handling unlike DomExceptions
gxml/Error.vala | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gxml/Error.vala b/gxml/Error.vala
new file mode 100644
index 0000000..759d107
--- /dev/null
+++ b/gxml/Error.vala
@@ -0,0 +1,12 @@
+namespace GXml {
+ public errordomain Error {
+ PARSER;
+ }
+
+ internal static string libxml2_error_to_string (Xml.Error *e) {
+ return "%s:%s:%d: %s:%d: %s".printf (
+ e->level.to_string ().substring (8 /* skipping XML_ERR_ */),
+ e->domain.to_string ().substring (9 /* skipping XML_FROM_ */),
+ e->code, e->file == null ? "<io>" : e->file, e->line, e->message);
+ }
+}
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]