Skip to content

Introduce '--show-backtrace' to show backtrace on compile error#4652

Closed
makenowjust wants to merge 1 commit intocrystal-lang:masterfrom
makenowjust:feature/crystal/show-backtrace
Closed

Introduce '--show-backtrace' to show backtrace on compile error#4652
makenowjust wants to merge 1 commit intocrystal-lang:masterfrom
makenowjust:feature/crystal/show-backtrace

Conversation

@makenowjust
Copy link
Contributor

On compiler development, we want to see exception's backtrace sometime. This option is for it.

On compiler development, we want to see exception's backtrace sometime.
This option is for it.
else
puts ex
if @show_backtrace
puts ex
Copy link
Contributor

Choose a reason for hiding this comment

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

ex.inspect_with_backtrace(STDERR)?

Copy link
Contributor Author

@makenowjust makenowjust Jul 1, 2017

Choose a reason for hiding this comment

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

No. inspect_with_backtrace uses ex.message, but full error message of Crystal::Exception is built by to_s method. So if use inspect_with_backtrace, we can't see full error message.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair 'nuff, and what about printing errors into STDERR instead of STDOUT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When #4494 is merged, I'll do it.

@asterite
Copy link
Member

asterite commented Jul 1, 2017

On compiler errors you write a spec, it fails and then you see the backtrace. Plus on a released compiler the backtrace will not be accurate because of --release.

@makenowjust
Copy link
Contributor Author

@asterite Yes. You are right.

@makenowjust makenowjust closed this Jul 1, 2017
@makenowjust makenowjust deleted the feature/crystal/show-backtrace branch August 7, 2017 04:49
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.

3 participants