how can I use exception handling in NetLogo? If I have an error it displays run-time error. I do not want to display this error, instead I want to catch it at run-time and do something else instead (like in c# or vb.net). Any help will be appreciated. Thanks
The carefully
primitive does exactly that, and the error message is available using error-message
:
carefully [
print mean [] ; try to take the mean of an empty list
] [
print error-message ; or do something else instead...
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With