influxdata / influxdb-client-php

InfluxDB (v2+) Client Library for PHP
https://influxdata.github.io/influxdb-client-php/
MIT License
150 stars 47 forks source link

fix: More fool-proof error message handling #155

Closed RobQuistNL closed 4 months ago

RobQuistNL commented 4 months ago

Proposed Changes

Changes the error thrown from something like this;

ErrorException
Undefined property: stdClass::$message

to something like this;

InfluxDB2\ApiException 
[500] Error connecting to the API (http://influxdb:8086/api/v2/query?org=-)(type error 1:35-1:76: function does not take a parameter "end", required params (start))

Checklist

codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.09%. Comparing base (443c62c) to head (c829a1b).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #155 +/- ## ============================================ + Coverage 75.00% 75.09% +0.09% - Complexity 432 433 +1 ============================================ Files 25 25 Lines 1100 1104 +4 ============================================ + Hits 825 829 +4 Misses 275 275 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

RobQuistNL commented 4 months ago

Thanks @bednar :)

I think I did all those things. Maybe best to add these requirements into the Contributing section or in a CONTRIBUTING.md file so in the future people spot it easier up front.

Thanks for reviewing so promptly!