Currently eval_code rescues StandardError, so it does not display Exception.
I realized this problem when I causes a NotImplementedError, which doesn't inherit StandardError.
Opal has not-implemented methods by design. For example, destructive methods for String. Some of these methods, such as String#gsub!, are popular, so the user may try to execute them.
However, currently NotImplementedError is not rescued, so it displays nothing if NotImplementedError occurs. I think it is confusing behavior.
Problem
Currently
eval_code
rescuesStandardError
, so it does not displayException
.I realized this problem when I causes a
NotImplementedError
, which doesn't inheritStandardError
. Opal has not-implemented methods by design. For example, destructive methods forString
. Some of these methods, such asString#gsub!
, are popular, so the user may try to execute them.However, currently
NotImplementedError
is not rescued, so it displays nothing ifNotImplementedError
occurs. I think it is confusing behavior.Solution
Rescue
Exception
to display all errors.Screenshots
before
after