Skip to content

Exception handling #45

@mkamensky

Description

@mkamensky

Could someone provide a more detailed explanation of the way exception handling works? I added

  register_exception ActiveRecord::RecordNotFound, status: 404

to my controller, but it does not seem to be caught. I stepped into it and verified that it is added to a list of handled exceptions, but couldn't find what I need to do for these to actually be rescued.

I previously used rescue_from, and don't mind using it again, but I would need to produce a standard jsonapi response, and couldn't find a method (in either graphiti or graphiti-rails) that would do that. Also couldn't find something that converts object.errors to such a format. I assume I'm missing something fundamental...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions