grex icon indicating copy to clipboard operation
grex copied to clipboard

Add custom error types when handling errors

Open jbmusso opened this issue 10 years ago • 0 comments

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!

jbmusso avatar Dec 10 '14 10:12 jbmusso