jsonapi-utils icon indicating copy to clipboard operation
jsonapi-utils copied to clipboard

JSONAPI::Utils::Exceptions::BadRequest undefined

Open melriffe opened this issue 6 years ago • 0 comments

Howdy!

I'm using the following gems:

  • jsonapi-resources (0.9.0)
  • jsonapi-utils (0.7.2)

I recently started using this gem and have found it quite useful. Thanks. However I tried to use jsonapi_render_bad_request and I got the following error:

# NameError:
#   uninitialized constant JSONAPI::Utils::Exceptions::BadRequest

It looks like the original refactoring to split up the exceptions into separate files resulted in BadRequest getting skipped/forgotten.

It seems, and this is without knowing the current design philosophy, updating jsonapi_render_bad_request to use JSONAPI::Exceptions::BadRequest directly, overriding detail: to match the original Utils BadRequest implementation could be one solution.

Another would be to implement JSONAPI::Utils::Exceptions::BadRequest.

Another would be to remove jsonapi_render_bad_request.

I'm happy to submit a pull request for any of those proposed solutions.

melriffe avatar May 30 '18 18:05 melriffe