Open Bug 458562 Opened 17 years ago Updated 3 years ago

Audit front-end code for unnecessary try/catch blocks

Categories

(Thunderbird :: Mail Window Front End, defect)

defect

Tracking

(Not tracked)

People

(Reporter: jminta, Unassigned)

Details

(Whiteboard: [patchlove])

Attachments

(1 file)

Attached patch patch v1Splinter Review
There are a lot of places where large chunks of code are kept in try/catch blocks, and errors are either swallowed or dump()ed. As a mac hacker, this can make errors easy to miss, and difficult to track down, because dump() does not end up in an easily viewable place. More importantly, these try/catch blocks can mask other errors, or hurt performance. This patch removes most of the obviously unncessary blocks. This patch looks bigger than it actually is, since removing a try/catch almost always requires adjusting whitespace. I haven't yet figured out how to force hg to give me a -w patch.
Attachment #341786 - Flags: review?(philringnalda)
In mailWindowOverlay.js::MsgFilters - gDBView.hdrForFirstSelectedMessage throws NS_ERROR_UNEXPECTED if there's a folder selected, but no message selected (select an empty folder then Tools - Message Filters is the easiest way to repro).
As does the gDBView.URIForFirstSelectedMessage in msgMail3PaneWindow.js::GetLoadedMessage
Error: treeView.selection is null Source File: chrome://messenger/content/msgMail3PaneWindow.js Line: 1291
Comment on attachment 341786 [details] [diff] [review] patch v1 Not going to be quite that easy.
Attachment #341786 - Flags: review?(philringnalda) → review-
(In reply to comment #0) > This patch looks bigger than it actually is, since removing a try/catch almost > always requires adjusting whitespace. I haven't yet figured out how to force hg > to give me a -w patch. hg diff -w is meant to work, but it seems it doesn't work for everyone. So, in your .hgrc file, to the [extensions] section add: hgext.extdiff = Then add a new section (if it isn't there already): [extdiff] cmd.diffw = diff opts.diffw = -NprwU8 Use the options that you prefer the most. You'll then have a new command 'hg diffw'

Is this still worth a look?

Assignee: jminta → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(mkmelin+mozilla)
Whiteboard: [patchlove]

Perhaps yes. There are some pieces there that are likely still useful.

Flags: needinfo?(mkmelin+mozilla)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: