Re: Using GError for document creation?



Hi Richard, I know I have an ipen issue with you just I haven't time these weeks.

Returning to your question. At GDA use of GError could be used for programmers too. When you create a simple maybe low level routine, you can add some checks about parameters but also to check returns values from other methods, even you can add some checks for your routine behavior, some problem detected must abort routine or the full program, if is at routine level, you can use GError to help developers find the problem and fix their code. This is the ,Unix philosophy, do just one thing but do it well.

Create low level routines, add checks for return values, behavior and actions, any detected problem must avoid aborts but inform problem nature and some info, for GLib based libraries use GError.

Then yes, use GError when possible to detect parsing problems, set correct domain, set message with some info and developers will be able to debug their and your code.

That's I think.

El sep 28, 2013 6:30 p.m., "Richard Schwarting" <richard schwarting ca> escribió:
Hello.

So Adam Ples who has submitted a patch for XPath was working on it earlier this month and wondered why we don't even use GErrors for parsing files into Documents. 

GError handling was removed for DOMExceptions because GError's intended use is for unanticipated runtime situations (like issues loading a file you expect) which a user might be able to address, rather than programming problems (you wrote code to add a child twice to the same tree) which the user can't do much about.

Any thoughts on adding GError handling to the Document constructors, then, like GXml.Document.from_path (), etc?

Cheerio,
  Richard

_______________________________________________
gxml-list mailing list
gxml-list gnome org
https://mail.gnome.org/mailman/listinfo/gxml-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]