Last Comment Bug 1115965 - Provide filename and line number in cal.WARN and cal.ERROR
: Provide filename and line number in cal.WARN and cal.ERROR
Status: RESOLVED FIXED
:
Product: Calendar
Classification: Client Software
Component: General (show other bugs)
: unspecified
: All All
-- normal (vote)
: 3.9
Assigned To: Geoff Lankow (:darktrojan)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-28 03:36 PST by Geoff Lankow (:darktrojan)
Modified: 2015-01-01 02:36 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
1115965-1.diff (2.10 KB, patch)
2014-12-28 03:37 PST, Geoff Lankow (:darktrojan)
philipp: review+
Details | Diff | Splinter Review
1115965-2.diff (2.19 KB, patch)
2014-12-28 04:41 PST, Geoff Lankow (:darktrojan)
philipp: review+
Details | Diff | Splinter Review

Description User image Geoff Lankow (:darktrojan) 2014-12-28 03:36:05 PST
nsIScriptError allows us to show the filename and line number of the error, so we should use it.
Comment 1 User image Geoff Lankow (:darktrojan) 2014-12-28 03:37:04 PST
Created attachment 8541909 [details] [diff] [review]
1115965-1.diff
Comment 2 User image Philipp Kewisch [:Fallen] 2014-12-28 04:20:59 PST
Comment on attachment 8541909 [details] [diff] [review]
1115965-1.diff

Review of attachment 8541909 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with these changes:

::: calendar/base/src/calUtils.js
@@ +925,3 @@
>                                  .createInstance(Components.interfaces.nsIScriptError);
> +    scriptError.init(aMessage, frame.filename.split(" -> ").pop(),
> +                     null, frame.lineNumber, 0,

Is it possible that frame.filename is null? I know its the case when calling from C code, although this doesn't apply here. But maybe there are other cases?

Also, might was well also pass columnNumber.


same applies for cal.ERROR of course.
Comment 3 User image Geoff Lankow (:darktrojan) 2014-12-28 04:41:23 PST
Created attachment 8541911 [details] [diff] [review]
1115965-2.diff

I suppose frame.filename could be null, although I think it's unlikely. Best to be safe, I suppose.
Comment 4 User image Philipp Kewisch [:Fallen] 2014-12-28 04:58:37 PST
Comment on attachment 8541911 [details] [diff] [review]
1115965-2.diff

Review of attachment 8541911 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the patch, r=philipp
Comment 5 User image Geoff Lankow (:darktrojan) 2015-01-01 02:36:54 PST
https://hg.mozilla.org/comm-central/rev/2e6ca0b22e1e

Note You need to log in before you can comment on or make changes to this bug.