JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Support Handling Of Error But Do Not Report To Rollbar

Open
#1,151 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.3k
Forks
546
PR merge metrics
No merged PRs in 30d

Description

We are using JSON API Resources on top of Elastic Search for some of our search endpoints. When bad input is submitted, Elastic Search appropriately raises an error. JSON API appropriately handles the error and returns a JSON API response. However, it also places the error in action_dispatch.exception where the error is picked up by other parts of the application. In our case, Rollbar detects the exception and it is reported.

Currently, the only way to avoid this is to whitelist the exception and handle it ourselves. Would it be possible to let JSON API continue to handle it but just not notify the framework?

This issue is a (choose one):

  • Problem/bug report.
  • Feature request.
  • Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead.

Checklist before submitting:

  • I've searched for an existing issue.
  • I've asked my question on Gitter and have not received a satisfactory answer.
  • I've included a complete bug report template. This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project.
  • The feature I'm asking for is compliant with the JSON:API spec.

Description

Choose one section below and delete the other:

Bug reports:

Please review Did you find a bug? and replace this content with a brief summary of your issue. If you can't submit a bug report template please be as thorough as possible when describing your your description. It's helpful to indicate which version of ruby and the JR gem you are using.

Features:

Please replace this line with a clear writeup of your feature request. Features that break compliance with the JSON:API spec will probably be closed.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the README's bug-report guidance and lib/bug_report_templates/rails_5_master.rb first, then trace how JSON API Resources handles Elastic Search errors and assigns action_dispatch.exception. The issue provides no source file or test entry point; done would require a documented, tested way to return the JSON API error without triggering framework-level reporting.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, rails, ruby
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.