Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backtrace: add support for generic backtraces #4

Merged
merged 2 commits into from
Dec 18, 2015

Conversation

kyrylo
Copy link
Contributor

@kyrylo kyrylo commented Dec 17, 2015

Sometimes exceptions can contain manual backtraces that quack similar to
Ruby exceptions, but do not stricly adhere their template. I stumbled
upon this issues, when I was working with SCSS. It sets a couple of
custom first frames such as:

Sass::SyntaxError: Undefined mixin 'animation'.
/home/app/assets/stylesheets/error_pages.scss:139:in `animation'
/home/app/app/assets/stylesheets/error_pages.scss:139

Previously, we were not able to parse the second frame.

Furthermore, we now raise error if we cannot parse a stack frame to
simplify debugguging and improving our parser.

@kyrylo kyrylo force-pushed the generic-backtraces-support branch from d7d5dd0 to db57cdd Compare December 17, 2015 15:43
Sometimes exceptions can contain manual backtraces that quack similar to
Ruby exceptions, but do not stricly adhere their template. I stumbled
upon this issues, when I was working with SCSS. It sets a couple of
custom first frames such as:

```
Sass::SyntaxError: Undefined mixin 'animation'.
/home/app/assets/stylesheets/error_pages.scss:139:in `animation'
/home/app/app/assets/stylesheets/error_pages.scss:139
```

Previously, we were not able to parse the second frame.

Furthermore, we now raise error if we cannot parse a stack frame to
simplify debugguging and improving our parser.
@kyrylo kyrylo force-pushed the generic-backtraces-support branch from b937533 to d778d92 Compare December 17, 2015 15:45
return match if match

unless (matched_frame = GENERIC_STACKFRAME_REGEXP.match(stackframe))
raise Airbrake::Error, "failed parsing '#{stackframe}'"

Choose a reason for hiding this comment

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

Nitpick: "Failed parsing" assumes that there was some failure, but here we just "can't parse".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by b31d680

@vmihailenco
Copy link

I don't understand who is responsible to parse Sass::SyntaxError: Undefined mixin 'animation'. from your example...

@kyrylo
Copy link
Contributor Author

kyrylo commented Dec 18, 2015

Sass::SyntaxError is an exception. Undefined mixin 'animation' is its message.

Its backtrace:

/home/app/assets/stylesheets/error_pages.scss:139:in `animation'
/home/app/app/assets/stylesheets/error_pages.scss:139
<other frames were omitted>

@vmihailenco
Copy link

LGTM

kyrylo added a commit that referenced this pull request Dec 18, 2015
backtrace: add support for generic backtraces
@kyrylo kyrylo merged commit 3b3e0fa into master Dec 18, 2015
@kyrylo kyrylo deleted the generic-backtraces-support branch December 18, 2015 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants