Hello, How does bugzilla 3.2/3.4/3.6 handle errors with Bug::check() ? Does it throw exceptions with die() ? Is this necessary ?
I'm sure you folks must have a more user-friendly API than this. We must be missing something. We are discussing this on: http://lists.mkgnu.net/pipermail/scmbug-users/2010-April/002745.html -------- Forwarded Message -------- From: Yavor Nikolov <[email protected]> To: Kristis Makris <[email protected]> Cc: scmbug-users <[email protected]> Subject: Re: [scmbug-users] Error on changing status of bugs with Bugzilla 3.4.x Date: Thu, 15 Apr 2010 09:24:25 +0300 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 ?
signature.asc
Description: This is a digitally signed message part
_______________________________________________ scmbug-users mailing list [email protected] http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users
