2

Sometimes in the scripts I run there are errors (for example one variable is undefined), and geth doesn't stop, it tries to run every line of the script, throwing errors everywhere.

I want to abort the script if I detect an error, but I don't how I can do that, the usual javascript functions don't work here. exit() (or exit) gives ReferenceError: 'exit' not defined, which is weird because when I'm in the console exit works fine.

How do I exit the script ? Is it possible ?

1

With ethereum-console you can use process.exit().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.