[Fwd: Re: [scmbug-users] Error on changing status of bugs with Bugzilla 3.4.x]
Kristis Makris
mkgnu at mkgnu.net
Thu Apr 15 17:04:45 UTC 2010
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 <nikolov.javor at gmail.com>
To: Kristis Makris <mkgnu at mkgnu.net>
Cc: scmbug-users <scmbug-users at lists.mkgnu.net>
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 <mkgnu at mkgnu.net> 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 ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.bugzilla.org/pipermail/developers/attachments/20100415/c0c65ec5/attachment.sig>
More information about the developers
mailing list