Closed franzliedke closed 5 years ago
ping @mswart for input
@franzliedke Looks good. Would really like to use it.
I think the important error codes are implemented.
Placing the exception classes side the parent class should work: like Restify::ClientError::NotFound
Naming? I'd like to avoid the ...Error suffix, if possible, but that would probably mean we need a new namespace. Can subclasses be nested in their own parent class' namespace?
Yes they can but I'd be fine with e.g. Restify::Unauthorized
. There shouldn't by any collisions and it is much easier to write and read.
Which error types do we want to handle? (It's easy to add new types later.) I went through our services and added those that we handle in a special way anywhere.
Unless you want to auto generate classes from the Rack status code mapping I'm fine with adding only needed.
Okay, updated the class names as coordinated in person. Ready from my side. 😉
This means specific errors can be handled directly by rescuing specific exception classes, instead of rescuing e.g.
Restify::ClientError
and then checking the exception'scode
orstatus
.Open questions:
...Error
suffix, if possible, but that would probably mean we need a new namespace. Can subclasses be nested in their own parent class' namespace?