grex
grex copied to clipboard
Add custom error types when handling errors
Consider passing custom/explicit error types to the callback when errors occur.
I can think of these errors right now:
-
NetworkError
Ex: no internet connection, should be easy to catch at the http module level -
ServerError
Ex: Rexster returns with a 500 error for some reasons (the HTTP code should be explicitely returned as well). -
TimeoutError
Ex: connected, but script timed out for various reasons (connection timeout? script timeout?) -
ScriptError
Ex: exception thrown by Rexster when executing the script.
There could be more (or less) errors. Maybe ConnectionError
and ClientError
. Thoughts welcomed!