markhoerth / dremio_client

Apache License 2.0
31 stars 25 forks source link

add response to error bad request exception #46

Closed insatomcat closed 4 years ago

insatomcat commented 4 years ago

As a client application, I'm very frustrated when I encounter a "Bad Request exception" because it does not tell me what was the problem. What do you thing of including the HTTP response body as a attribute of the exception, so that a client have all the details when that happens ?

      except DremioBadRequestException as e:
        print(str(e.response.json()['errorMessage']))
        pass
codecov[bot] commented 4 years ago

Codecov Report

Merging #46 into master will decrease coverage by 0.05%. The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
- Coverage   54.51%   54.46%   -0.06%     
==========================================
  Files          22       22              
  Lines        1484     1491       +7     
==========================================
+ Hits          809      812       +3     
- Misses        675      679       +4     
Impacted Files Coverage Δ
dremio_client/model/endpoints.py 56.37% <75.00%> (-0.87%) :arrow_down:
dremio_client/error.py 100.00% <100.00%> (ø)
dremio_client/dremio_simple_client.py 48.75% <0.00%> (+0.03%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9c7167c...934f1a3. Read the comment docs.

rymurr commented 4 years ago

hey @insatomcat sorry for the delay. Super useful addition. Could you add to the DremioException class so that all exception types benefit?

insatomcat commented 4 years ago

hey @insatomcat sorry for the delay. Super useful addition. Could you add to the DremioException class so that all exception types benefit?

done, tell me what you think.