Closed Bug 310111 Opened 19 years ago Closed 15 years ago

Milestone::check_milestone and similar subroutines should return a generic error

Categories

(Bugzilla :: Bugzilla-General, defect)

2.21
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: gregaryh, Unassigned)

Details

Currently they simply throw a user error. This makes it less than desireable for
non cgi scripts such as importxml.pl. This means if an invalid milestone is
passed, control exits the calling script and is taken over by the Template code.

It should instead return an error code and the calling code should handle it.
Blocks: 285614
Look at Bugzilla->batch

If set to one, it will keep the Throw*Error functions from exiting so they can
be called from within an eval to field these sorts of errors.  Does that cover
your application?
How do I set it to 1?
I guess this bug should be more generic and involve all .pm modules. Maybe
should ThrowUserError() check whether i_am_cgi() is true or false, and return
the error message accordingly, i.e. with or without HTML.
I have set the batch to 1 and used evals but it still seems to be a not very elegent solution. 
No longer blocks: 285614
(In reply to comment #4)
> I have set the batch to 1 and used evals but it still seems to be a not very
> elegent solution. 
> 

That's the solution I used in bug 174039 and it's working fine. Not really elegant, I agree but this works for now.
Bugzilla ERROR_MODES makes this moot.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.