Exception on tab complete not caught #632

Closed
joliss opened this Issue Jul 5, 2012 · 4 comments

Comments

Projects
None yet
4 participants
@joliss

joliss commented Jul 5, 2012

Pry crashed when I pressed tab:

[7] pry(main)> Forgery(:name)Error: unmatched close parenthesis: /^:name)/
FATAL: Pry failed to get user input using `Readline`.
To fix this you may be able to pass input and output file descriptors to pry directly. e.g.
  Pry.config.input = STDIN
  Pry.config.output = STDOUT
  binding.pry

I'm thinking there could be a catch-all exception handler around the tab completion code that stops it from crashing.

@banister

This comment has been minimized.

Show comment
Hide comment
@banister

banister Jul 5, 2012

Member

I agree, broken tab completion should never cause a crash, thanks :)

Member

banister commented Jul 5, 2012

I agree, broken tab completion should never cause a crash, thanks :)

@YorickPeterse

This comment has been minimized.

Show comment
Hide comment
@YorickPeterse

YorickPeterse Jul 5, 2012

Member

I believe this issue (or at least similar ones) were already fixed in ea016d8 and following commits.

Member

YorickPeterse commented Jul 5, 2012

I believe this issue (or at least similar ones) were already fixed in ea016d8 and following commits.

@joliss

This comment has been minimized.

Show comment
Hide comment
@joliss

joliss Jul 5, 2012

Great, so that fixes this specific crash.

How do you feel about wrapping the entire tab completion code in an exception handler (so pry can't crash from it)?

joliss commented Jul 5, 2012

Great, so that fixes this specific crash.

How do you feel about wrapping the entire tab completion code in an exception handler (so pry can't crash from it)?

@YorickPeterse

This comment has been minimized.

Show comment
Hide comment
@YorickPeterse

YorickPeterse Jul 5, 2012

Member

That sounds like a plan. However, and this is something that bothered by before, I want it to (optionally) display a stack trace. When I tried to fix this issue the error message displayed by Pry wasn't particular useful and I had to manually insert code to get the stack trace to show up.

Because of this I propose the introduction of a new option: --verbose. When set Pry error messages would display stack traces and other information that might be useful when debugging an issue.

Member

YorickPeterse commented Jul 5, 2012

That sounds like a plan. However, and this is something that bothered by before, I want it to (optionally) display a stack trace. When I tried to fix this issue the error message displayed by Pry wasn't particular useful and I had to manually insert code to get the stack trace to show up.

Because of this I propose the introduction of a new option: --verbose. When set Pry error messages would display stack traces and other information that might be useful when debugging an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment