projects
/
moonshot-ui.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
09d7a8a
)
Initial web provisioning parsing, error handling
author
Alberto Ruiz
<aruiz@gnome.org>
Mon, 4 Jul 2011 12:56:09 +0000
(13:56 +0100)
committer
Alberto Ruiz
<aruiz@gnome.org>
Mon, 4 Jul 2011 12:56:09 +0000
(13:56 +0100)
src/moonshot-webp-parser.vala
patch
|
blob
|
history
diff --git
a/src/moonshot-webp-parser.vala
b/src/moonshot-webp-parser.vala
index
2865432
..
e7bda5b
100644
(file)
--- a/
src/moonshot-webp-parser.vala
+++ b/
src/moonshot-webp-parser.vala
@@
-33,11
+33,6
@@
namespace WebProvisioning
}*/
}
}*/
}
- public void parser_error (MarkupParseContext context,
- Error error)
- {
- debug ("error");
- }
public static int main (string[] args)
{
public static int main (string[] args)
{
@@
-66,7
+61,18
@@
namespace WebProvisioning
error ("Could not retreive file size");
}
error ("Could not retreive file size");
}
- MarkupParser parser = {start_element_func, end_element_func, text_element_func, null, parser_error};
+ MarkupParser parser = {start_element_func, end_element_func, text_element_func, null, null};
+
+ var ctx = new MarkupParseContext(parser, 0, null, null);
+
+ try
+ {
+ ctx.parse (text, text.length);
+ }
+ catch (Error e)
+ {
+ error ("Could not parse %s, invalid content", args[1]);
+ }
return 0;
return 0;