influxdb-php icon indicating copy to clipboard operation
influxdb-php copied to clipboard

Manage connect exception

Open soullivaneuh opened this issue 7 years ago • 3 comments

I simulated an InfluxDB server crash to see how my app work.

I got an exception directly from Guzzle library:

image

Guzzle is used by your library but not by the user. The end use should rely to your exception only IMHO.

If think it would be better to have you own generic exception for that.

What do you think?

soullivaneuh avatar Jul 18 '16 15:07 soullivaneuh

:+1: , having a custom exception that would be thrown no matter what the exception is behind would allow to change implementations more easily. The underlying exception could still be passed as the $previous argument of the constructor.

greg0ire avatar Jul 18 '16 20:07 greg0ire

+1

realandraja avatar May 01 '17 19:05 realandraja

Other drivers should probably be expected to throw exceptions as well, not just Guzzle-based one. It would probably be a BC break for them though, since it will cause them to start crashing instead of silently ignoring errors?

Steveb-p avatar Feb 27 '19 09:02 Steveb-p