Closed Bug 257344 Opened 20 years ago Closed 20 years ago

Remove Exit from common subroutines

Categories

(Bugzilla :: Bugzilla-General, defect, P2)

2.19

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: bugreport, Assigned: bugreport)

References

Details

Attachments

(1 file)

If a routine is called and throws an error, that error ends with exit() instead of die(). exit() cannot be trapped by an eval {} while die() can be. This means that neither whining nor collectstats can reciver from an error in one query and continue on to the next query.
Blocks: 257346
Blocks: 257351
The way to do this is probably to make a new Bugzilla->Batch that, if set, causes all the error code to use die() instead of exit() so errors can be caught.
Assignee: justdave → bugreport
Priority: -- → P2
Target Milestone: --- → Bugzilla 2.22
This has wider implications than just cron scripts. What about alternative UIs that need non-HTML error messages? We really need a much more broadly encompassing exception mechanism. See also bug 173626.
Attachment #161114 - Flags: review?(justdave)
Comment on attachment 161114 [details] [diff] [review] Patch v1 - captures errors to die() if Bugzilla->batch has been called with non-zero argument r=glob, while the output isn't pretty, it's better than it falling through.
Attachment #161114 - Flags: review+
This should make Gerv and Erik's existing eval's trap the errors properly.
Flags: blocking2.20?
Flags: approval?
Target Milestone: Bugzilla 2.22 → Bugzilla 2.20
Comment on attachment 161114 [details] [diff] [review] Patch v1 - captures errors to die() if Bugzilla->batch has been called with non-zero argument I'm not sure batch is a good name for this, but "noninteractive" seems too long, and I can't come up with anything better. Otherwise this looks nice.
Attachment #161114 - Flags: review?(justdave)
Flags: blocking2.20?
Flags: blocking2.20+
Flags: approval?
Flags: approval+
Checked in.... Erik, Gerv: You're on....
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Blocks: 277073
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: