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

Exception subclasses without a message method aren't handled well by the top level exception handler #4405

Closed
p6rt opened this issue Jul 16, 2015 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Jul 16, 2015

Migrated from rt.perl.org#125620 (status was 'resolved')

Searchable as RT125620$

@p6rt
Copy link
Author

p6rt commented Jul 16, 2015

From @hoelzro

For example​:

  $ perl6 -e 'class CustomException is Exception {}; CustomException.new.throw'

This results in the following error output​:

Unhandled exception​: concatenate requires a concrete string, but got null
  at <unknown>​:1 (/home/rob/.mokudo/share/perl6/runtime/CORE.setting.moarvm​:print_exception​:4294967295)
from src/gen/m-CORE.setting​:15582 (/home/rob/.mokudo/share/perl6/runtime/CORE.setting.moarvm​:<anon>​:43)
from gen/moar/stage2/NQPHLL.nqp​:1420 (/home/rob/.mokudo/share/nqp/lib/NQPHLL.moarvm​:command_eval​:380)
from src/Perl6/Compiler.nqp​:59 (/home/rob/.mokudo/share/nqp/lib/Perl6/Compiler.moarvm​:command_eval​:93)
from gen/moar/stage2/NQPHLL.nqp​:1360 (/home/rob/.mokudo/share/nqp/lib/NQPHLL.moarvm​:command_line​:116)
from src/gen/m-main.nqp​:39 (/home/rob/.mokudo/share/perl6/runtime/perl6.moarvm​:MAIN​:18)
from src/gen/m-main.nqp​:35 (/home/rob/.mokudo/share/perl6/runtime/perl6.moarvm​:<mainline>​:197)
from <unknown>​:1 (/home/rob/.mokudo/share/perl6/runtime/perl6.moarvm​:<main>​:8)
from <unknown>​:1 (/home/rob/.mokudo/share/perl6/runtime/perl6.moarvm​:<entry>​:9)

Adding a message method to CustomException causes the exception handler to print out more normal-looking output.

@p6rt
Copy link
Author

p6rt commented Jul 18, 2015

From @jnthn

On Wed Jul 15 20​:57​:03 2015, rob@​hoelz.ro wrote​:

For example​:

$ perl6 -e 'class CustomException is Exception {};
CustomException.new.throw'

This results in the following error output​:

Unhandled exception​: concatenate requires a concrete string, but got
null
at <unknown>​:1
(/home/rob/.mokudo/share/perl6/runtime/CORE.setting.moarvm​:print_exception​:4294967295)
from src/gen/m-CORE.setting​:15582
(/home/rob/.mokudo/share/perl6/runtime/CORE.setting.moarvm​:<anon>​:43)
from gen/moar/stage2/NQPHLL.nqp​:1420
(/home/rob/.mokudo/share/nqp/lib/NQPHLL.moarvm​:command_eval​:380)
from src/Perl6/Compiler.nqp​:59
(/home/rob/.mokudo/share/nqp/lib/Perl6/Compiler.moarvm​:command_eval​:93)
from gen/moar/stage2/NQPHLL.nqp​:1360
(/home/rob/.mokudo/share/nqp/lib/NQPHLL.moarvm​:command_line​:116)
from src/gen/m-main.nqp​:39
(/home/rob/.mokudo/share/perl6/runtime/perl6.moarvm​:MAIN​:18)
from src/gen/m-main.nqp​:35
(/home/rob/.mokudo/share/perl6/runtime/perl6.moarvm​:<mainline>​:197)
from <unknown>​:1
(/home/rob/.mokudo/share/perl6/runtime/perl6.moarvm​:<main>​:8)
from <unknown>​:1
(/home/rob/.mokudo/share/perl6/runtime/perl6.moarvm​:<entry>​:9)

Adding a message method to CustomException causes the exception
handler to print out more normal-looking output.

It's actually the gist method on such an exception that is rather busted. Fixed it so now you get​:

$ perl6-m -e "class CustomException is Exception {}; CustomException.new.throw"
Died with CustomException
  in block <unit> at -e​:1

Which is somewhat more informative. :-) Added tests in S32-exceptions/misc.t.

@p6rt
Copy link
Author

p6rt commented Jul 18, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 18, 2015

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jul 18, 2015
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

No branches or pull requests

1 participant