trailblazer/trailblazer-rails

Operation don't return errors

Closed this issue · 4 comments

Yeah, we were talking about it a few days ago - do you want to replace it with operation.errors (incl. a test)? 😬

ASnow commented

Yes. operation.errors will be nice. Default HAL responder just return json with: {errors: [1]}. It's real pain for development env and break some error handling logics for production.

How can I work around this issue now? This really upsets me when I am so close to building a good api using a trailblazer.

Haha, it's basically

def errors
  contract.errors
end

I will push it later.