Bugzilla does throw exceptions (in a "die" way) on certain places: e.g. - on calling Bug::check(), when providing bad user - Invalid duplicate bug id ... etc.
I.e. - more often Bugzilla throws exception when error is encountered (bad parameter, lack of permissions, etc.) than returning an error code. Actually - exception handling is in general a cleaner approach to manage error situations than dealing with return codes. Just the die/eval/$@/.. is some kind of limited workaround since older versions of Perl didn't have exceptions. So what happens if we don't catch these exceptions: scmbug dies, error message is logged in scmbug log. However end user gets a general purpose error which doesn't explain the root cause of the problem (i.e. user receives something like "scmbug died for unknown reason" than duplicate bug id is bad; or we don't have permissions to edit the bug). Regards, Yavor On Thu, Apr 15, 2010 at 02:18, Kristis Makris <[email protected]> wrote: > > > If there is a possibility for Bugzilla to raise exceptions > > inside the > > eval {} blocks, is there another way of eliminating that > > possibility ? > > I think If we use the WebService API error would be signalled in a bit > > different manner. Another approach would be to patch Bugzilla. > > I suppose my question is, why are we so fearful that something bad will > happen that will throw an exception ? Can't we simply check the return > values of function calls to see if the calls succeeded ? > > >
_______________________________________________ scmbug-users mailing list [email protected] http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users
