JoshCheek / seeing_is_believing

Displays the results of every line of code in your file
1.31k stars 54 forks source link

Exceptions in `at_exit` hooks look like they came from SiB #49

Closed JoshCheek closed 9 years ago

JoshCheek commented 9 years ago

Example:

$ seeing_is_believing -e 'at_exit { raise "omg" }'

This happens in the real world, for example, Atom sets its CWD to the root dir. If user is running some piece of code with an at_exit hook that raises an exception (e.g. they run it on a test and SimpleCov tries to write the results to "./coverage", but cwd is "/", making this "/coverage", which it can't access, and thus Errno::EACCES is raised from the at_exit hook.

In Atom, this leads to an error screen about bug reporting:

sib-blows-up-ss

Correct behaviour is to print the error at the end, like we would print any other error.

Perhaps we can identify errors raised from within SiB vs outside it by looking at the backtrace?

Thanks to @katelane for reporting.

JoshCheek commented 9 years ago

Fixed a while back.

https://github.com/JoshCheek/seeing_is_believing/blob/v3.0/features/regression.feature#L397-416