You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I'm not connected to the internet, curl fails to get weather data which causes parse@json to fail, and also terminates the execution of my prelude early. I think that we should try to make a convenient way to handle errors (although the parsing functions should be implemented such that they return None instead of throwing errors).
I'm thinking of implementing a try builtin function that might behave like the following:
try 2 // 0 { echo "divide by zero"; 0 }
try would attempt to evaluate the first argument If it does not throw an error, then try will return that result. If the first argument fails to evaluate, it would evaluate the second argument, and return its result.
The text was updated successfully, but these errors were encountered:
When I'm not connected to the internet,
curl
fails to get weather data which causesparse@json
to fail, and also terminates the execution of my prelude early. I think that we should try to make a convenient way to handle errors (although the parsing functions should be implemented such that they returnNone
instead of throwing errors).I'm thinking of implementing a
try
builtin function that might behave like the following:try
would attempt to evaluate the first argument If it does not throw an error, thentry
will return that result. If the first argument fails to evaluate, it would evaluate the second argument, and return its result.The text was updated successfully, but these errors were encountered: