[Fwd: Re: [scmbug-users] Error on changing status of bugs with Bugzilla 3.4.x]

Max Kanat-Alexander mkanat at bugzilla.org
Mon Apr 19 08:02:17 UTC 2010


On 04/18/2010 09:24 AM, Kristis Makris wrote:
> 1. Does the check() call return a value we could test for error (rather
> than parse an error message string), and

	Hey Kristis. No, check() throws exceptions when there is a problem.

> 2. How can we avoid the scmbug process calling check() from dieing ?

	You can't--"die" is how Perl throws exceptions.

> You mentioned Bugzilla->error_mode(ERROR_MODE_DIE). That sounds like it
> would lead the process to die.

	It will lead the process to use "die" to throw errors. By default this 
is what scmbug will do anyhow, because that is the default for 
command-line applications.

> What is the "normal" error mode in which
> the call to check() won't die, if there is one ?

	The call to check() will always throw an error if there is a 
problem--that is what check() does. You could re-implement all of the 
checks that check() does yourself, which would be fragile in terms of 
forward-compatibility, or you could just call it and return the error to 
the user if there is an error.

>  From a design standpoint, I am not convinced that "eval" needs to be
> part of the call to check().

	The standard Perl exception-catching mechanism is eval {}. It's 
confusing, I know, but that's what it is. eval("") is slow, eval {} is fast.

	-Max
-- 
http://www.everythingsolved.com/
Competent, Friendly Bugzilla and Perl Services. Everything Else, too.



More information about the developers mailing list