zmactep / hasbolt

Haskell driver for Neo4j 3+ (BOLT protocol)
BSD 3-Clause "New" or "Revised" License
82 stars 13 forks source link

Exposing ResponseError data type #34

Open onepunchtech opened 2 years ago

onepunchtech commented 2 years ago

I'm wondering if it would be a good idea to expose the ResponseError constructors to allow users to make smarter decisions about errors.

For example the error type "Neo.ClientError.Schema.ConstraintValidationFailed" can sometimes be used to determine if there should be a user input error vs an internal server error. Similar to 400 vs 500 http error codes.

Or am I missing some other method to be able to distinguish between the error types in the KnownResponseFailure?