prestodb / presto-js-client

Monorepo for Presto JavaScript packages
Apache License 2.0
10 stars 2 forks source link

feat(presto-client): return back the whole error object #17

Closed alonsovb closed 10 months ago

alonsovb commented 10 months ago

Changes

Resolves #11

alonsovb commented 10 months ago

Good idea @jorgeramirezamora , I'll include an example of using the returned error 👍

yhwang commented 10 months ago

I believe the error handling is deviating from the documentation. But the doc update could come later :-) +1 for the test case.

LGTM

alonsovb commented 10 months ago

I created an interface for PrestoError but I'm now thinking that it should be a class, so that you can do

catch (error) {
  if (error instanceof PrestoError) { ... }
}

so I'll take some time to refactor that