Closed
Bug 812764
Opened 12 years ago
Closed 11 years ago
Errors don't carry any meaningful information on them
Categories
(DevTools :: Debugger, defect, P2)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 27
People
(Reporter: vporof, Assigned: fitzgen)
References
Details
Attachments
(1 file, 1 obsolete file)
4.37 KB,
patch
|
past
:
review+
|
Details | Diff | Splinter Review |
The only thing available on instances of Error is __proto__, which, as expected, contains empty strings for the name and message properties. This makes the pause-on-exceptions unusable in some cases and watch expressions to display strings instead of error objects for now.
See https://bugzilla.mozilla.org/show_bug.cgi?id=727429#c13
Updated•12 years ago
|
Assignee: nobody → past
Priority: -- → P3
Comment 1•12 years ago
|
||
Bumping the priority on this, since it's starting to get on my nerves.
Priority: P3 → P2
Updated•11 years ago
|
Assignee: past → ejpbruel
Assignee | ||
Comment 3•11 years ago
|
||
Sorry for stealing the bug, Eddy, but I was talking with a dev and he was really annoyed by this, so I looked into it, and I was able to fix it in the server layer really quick.
Assignee | ||
Comment 4•11 years ago
|
||
Sorry, didn't add the test file in the last patch.
Attachment #816783 -
Attachment is obsolete: true
Attachment #816783 -
Flags: review?(past)
Attachment #816784 -
Flags: review?(past)
Comment 5•11 years ago
|
||
It might be good to note whether _forceMagicProperties has been run on this object and bail out after the first time doing it.
Comment 6•11 years ago
|
||
Comment on attachment 816784 [details] [diff] [review]
error-properties.patch
Review of attachment 816784 [details] [diff] [review]:
-----------------------------------------------------------------
Thank you Nick, this was really important!
I still think fixing the platform to avoid the need for this workaround would be preferable, so if Eddy agrees, I would suggest that we file a followup for the better fix. I don't think it's useful for the Debugger.Object reflection of an error object to not have these properties eagerly fetched. XPCOM's Components.Exception is already reflected properly as a Debugger.Object, so a JS Error should too.
(In reply to Brandon Benvie [:bbenvie] from comment #5)
> It might be good to note whether _forceMagicProperties has been run on this
> object and bail out after the first time doing it.
I agree with Brandon here. The message and stack properties can be quite large in some cases, and the extra memory overhead from copying them across the engine boundary could be a problem with mobile devices.
::: toolkit/devtools/server/actors/script.js
@@ +2697,5 @@
> + const MAGIC_ERROR_PROPERTIES = [
> + "message", "stack", "fileName", "lineNumber", "columnNumber"
> + ];
> +
> + if (this.obj.class.endsWith("Error")) {
This wouldn't catch custom errors with funny names, would it? I think a better approach is to check that this.obj.proto && this.obj.proto.class == "Error" or at least this.obj.proto.class.endsWith("Error").
Attachment #816784 -
Flags: review?(past) → review+
Assignee | ||
Comment 7•11 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Assignee | ||
Comment 8•11 years ago
|
||
(In reply to Panos Astithas [:past] from comment #6)
> Comment on attachment 816784 [details] [diff] [review]
> error-properties.patch
>
> Review of attachment 816784 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Thank you Nick, this was really important!
>
> I still think fixing the platform to avoid the need for this workaround
> would be preferable, so if Eddy agrees, I would suggest that we file a
> followup for the better fix. I don't think it's useful for the
> Debugger.Object reflection of an error object to not have these properties
> eagerly fetched. XPCOM's Components.Exception is already reflected properly
> as a Debugger.Object, so a JS Error should too.
Filed bug 927019
>
> (In reply to Brandon Benvie [:bbenvie] from comment #5)
> > It might be good to note whether _forceMagicProperties has been run on this
> > object and bail out after the first time doing it.
>
> I agree with Brandon here. The message and stack properties can be quite
> large in some cases, and the extra memory overhead from copying them across
> the engine boundary could be a problem with mobile devices.
Done.
>
> ::: toolkit/devtools/server/actors/script.js
> @@ +2697,5 @@
> > + const MAGIC_ERROR_PROPERTIES = [
> > + "message", "stack", "fileName", "lineNumber", "columnNumber"
> > + ];
> > +
> > + if (this.obj.class.endsWith("Error")) {
>
> This wouldn't catch custom errors with funny names, would it? I think a
> better approach is to check that this.obj.proto && this.obj.proto.class ==
> "Error" or at least this.obj.proto.class.endsWith("Error").
Subclasses don't inherit the magic properties.
Reporter | ||
Comment 9•11 years ago
|
||
\o/
Comment 10•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 27
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•