wren
wren copied to clipboard
Fiber.abort(null) continues execution
Making a note to investigate this.
System.print("hello wren")
Fiber.abort("end")
S:ystem.print("after abort")
gets the expected runtime error
hello wren
end
[compile line 2] in (script)
while this one
System.print("hello wren")
Fiber.abort(null)
System.print("after abort")
still prints
hello wren
after abort
This behavior is normal per definition of fiber error. A non null value in a fiber error indicates that a fiber is in an error state. Therefore a null value indicates there is no error, and trying setting it to null should behave as this.
That said it is a little bit not intuitive, but doing otherwise would requires to use other bytes or use the other null (undefined) to implement an optional value like interface...
It's also as documented: If the message is null , does nothing.
Might even be useful for generating conditional errors.
Probably best left as it is.
thanks yea, I know it's documented, but it bit me when forwarding errors in larger scale projects so ✨
Making a note to investigate this.