Hi Now that I've started to work on generalizing the dynamic reconfiguration hack, I bumped into the quite complex or at least unnecessarily complex error mangement scheme currently used in nbd-server.c. There seems to be several different error reporting styles: fprintf(), msgX(), g_warning(), perror(). Maybe we could try to uniform this somehow?
But the real problem is, that in many places, error reporting and handling is tightly coupled and buried inside utility functions. Uses of err() or perror() followed by exit() are good examples. I do realize that there probably hasn't been a real need for separating reporting from handling earlier, but now there is. To exploit the existing code base, error handling (i.e. the decisions to what to make in case of an error) needs to be separeted from error reporting: calling a function which might call exit() in the middle of a reconfiguration process is obviously going to cause troubles sooner or later. My suggestion is that because we are already depending on libglib and using it's error reporting framework in few places, we should try to use the same mechanism everywhere. In other words, we should pass GError** to functions requiring an error reporting mechanism and then make the error handling decisions in the caller. Thoughts? Best regards, -- Tuomas ------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 _______________________________________________ Nbd-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nbd-general
