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)
Thunderbird
Mail Window Front End
Tracking
(Not tracked)
NEW
People
(Reporter: jminta, Unassigned)
Details
(Whiteboard: [patchlove])
Attachments
(1 file)
|
83.56 KB,
patch
|
philor
:
review-
|
Details | Diff | Splinter 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)
Comment 1•17 years ago
|
||
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).
Comment 2•17 years ago
|
||
As does the gDBView.URIForFirstSelectedMessage in msgMail3PaneWindow.js::GetLoadedMessage
Comment 3•17 years ago
|
||
Error: treeView.selection is null
Source File: chrome://messenger/content/msgMail3PaneWindow.js
Line: 1291
Comment 4•17 years ago
|
||
Comment on attachment 341786 [details] [diff] [review]
patch v1
Not going to be quite that easy.
Attachment #341786 -
Flags: review?(philringnalda) → review-
Comment 5•17 years ago
|
||
(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'
Comment 6•5 years ago
|
||
Is this still worth a look?
Assignee: jminta → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(mkmelin+mozilla)
Whiteboard: [patchlove]
Comment 7•5 years ago
|
||
Perhaps yes. There are some pieces there that are likely still useful.
Flags: needinfo?(mkmelin+mozilla)
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•