Reputation: 936
If I run the following using pulp run
the process ends with status 0.
main :: forall e. Eff (console :: CONSOLE | e) Int
main = do
log "Hello sailor!"
pure 137
How can I exit the program with an error without throwing an exception?
Upvotes: 1
Views: 112
Reputation: 80880
If you're running on Node (which is what pulp run
does), you should use Node facilities for this. Specifically, the function you want is Node.Process.exit:
import Node.Process(exit)
main = do
log "Hello sailor!"
exit 137
Upvotes: 1