Skip to content
This repository has been archived by the owner on Jul 23, 2018. It is now read-only.

push frames without context on file read errors in the parser #22

Merged
merged 1 commit into from
Apr 10, 2014

Conversation

dan-manges
Copy link
Contributor

I think the intention on file read errors is to push the frame without context. There's a comment in the parser that says:

// There was an error reading the file, just push the frame and
// move on.

However, because looper was being called instead of pendingCallback, an error reading a file is causing rollbar to bubble the exception up through all the callbacks and never notify.

@dan-manges
Copy link
Contributor Author

any thoughts on this @brianr or @sbezboro?

@brianr
Copy link
Member

brianr commented Apr 10, 2014

Hey @dan-manges , sorry for the delay, will try to find some time to review and merge today.

@@ -106,7 +106,7 @@ exports.parseStack = function(stack, callback) {
try {
if (err2) {
console.error('could not read in file ' + frame.filename + ' for context');
return looper(err2);
return pendingCallback(err2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason you did this instead of:

frames.push(frame);
return;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Er,

frames.push(frame);
return looper(null);

I think I'm going to merge as-is for now, but wanted to mention.

@brianr brianr merged commit ebabd5c into rollbar:master Apr 10, 2014
@brianr
Copy link
Member

brianr commented Apr 10, 2014

Merged, thanks! This will get pushed to npm in 0.3.3, which will be later today.

@dan-manges
Copy link
Contributor Author

Thanks for merging this @brianr. I think the only reason I called pendingCallback instead of pushing the frame and calling looper was because of the comment near the top of pendingCallback:

// There was an error reading the file, just push the frame and
// move on.
if (err) {
            frames.push(frame);

I thought that maybe the intent was to have all error handling flow into that logic branch but somebody accidentally called looper instead of pendingCallback. But that might not have been the intent, and I like your suggestion of pushing the frame immediately. Let me know if you want me to change it.

@dan-manges dan-manges deleted the fix-parser-on-file-read-error branch April 10, 2014 19:31
@brianr
Copy link
Member

brianr commented Apr 10, 2014

@coryvirok do you have an opinion here?

@coryvirok
Copy link
Contributor

@dan-manges, thanks for the fix. @brianr, I prefer the way @dan-manges has it here so we only handle the error case in 1 place.

This code is way too complicated. I'll file a task to refactor.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants