Fork me on GitHub
#yada
<
2016-12-21
>
naartjie16:12:27

Is there a straight forward way to use Exceptions for 400 responses? i.e. can my handler fn throw some special "client error" type exception, and the response will be a 400, with a body I specify, and not a 500 server error?

malcolmsparks16:12:29

Yes. Throw a ex-info with :status and :body in the ex-data map

naartjie16:12:36

Thanks @malcolmsparks. I thought I had tried that, but it might be something specific with my setup that's mangling it somewhere along the way.

malcolmsparks16:12:20

Good idea to look at the code for the return interceptor.

naartjie16:12:56

Will do. Thanks for the help!!

malcolmsparks16:12:04

@nha thanks for reporting. The last release is a work in progress - I thought I'd done rnough to release without breaking anything -