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

"fail" inside BUILD is ignored #5372

Closed
p6rt opened this issue Jun 13, 2016 · 3 comments
Closed

"fail" inside BUILD is ignored #5372

p6rt opened this issue Jun 13, 2016 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 13, 2016

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

Searchable as RT128393$

@p6rt
Copy link
Author

p6rt commented Jun 13, 2016

From @salortiz

In latest nom failing inside BUILD can't be detected anymore​:

<sortiz> star-m​: class Foo { submethod BUILD { fail "noway" } } ; with Foo.new { say "good" } else { .fail }
<camelia> star-m 2016.04​: OUTPUT«noway␤ in submethod BUILD at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤Actually thrown at​:␤ in block <unit> at <tmp> line 1␤␤»
<sortiz> m​: class Foo { submethod BUILD { fail "noway" } } ; with Foo.new { say "good" } else { .fail }
<camelia> rakudo-moar 5d4949​: OUTPUT«good␤»

Bisectable points to commit d5e09d9 "Streamline Mu.BUILDALL"​:

<sortiz> bisect​: class Foo { submethod BUILD { fail "noway" } } ; Foo.new ~~ Failure;
<bisectable> sortiz​: exit code on a “good” revision is 1 (which is bad), bisecting with inverted logic
<bisectable> sortiz​: (2016-06-11) rakudo/rakudo@d5e09d9

In my real use case, the failure is detected and reported much later, at DESTROY time​:

WARNING​: unhandled Failure detected in DESTROY​:
Env open 'NoSuChDiR'​: No such file or directory
  in submethod BUILD at /home/sog/work/MyGIT/p6-LMDB/lib/LMDB.pm6 (LMDB) line 240

@p6rt
Copy link
Author

p6rt commented Jun 13, 2016

From @salortiz

Solved by lizmat++ in rakudo/rakudo@b351d61006
with tests in Raku/roast@f2105b8c40

@p6rt
Copy link
Author

p6rt commented Jun 13, 2016

@salortiz - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Jun 13, 2016
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant