Comments (3)
I wonder if we took the current code
rescue_from Exception do |e|
handle_exception(e, show_raw_error: !!current_user.internal)
end
And threw a deprecation. Then document that customizing behavior is done with register_exception
instead of rescue_from
(so we can make more adjustments to the resulting payload, and do so with a class-based interface), and handle everything with ActionDispatch (which would grab the relevant registered exception and handle appropriately).
Does this sound feasible or am I off base?
from graphiti-rails.
I like the general idea, the main issue is that in the current implementation we only go through the GraphitiError handlers for JSON:API by default, with other content types being opt-in. So there could easily be a case where someone registers an exception but uses a different content type and it never gets used.
from graphiti-rails.
See #19 for a better overview of the problem.
from graphiti-rails.
Related Issues (20)
- Move Graphiti::Railtie here HOT 1
- [REGRESSION] Return `__raw_error__` for Vandal and Remote Resources
- Auto-include `Responders` module if responders gem is present HOT 1
- Add config option to omit __details__ HOT 1
- `context_for_endpoint` doesn't work if you have routing constraints HOT 1
- ResourceGenerator overwrites existing controller HOT 1
- Generated file namespacing incorrect after updating namespace
- Exception handling HOT 9
- Failure when log_level is a symbol HOT 1
- My attribute values are saved as NULL
- Include Graphiti stuff only in api HOT 11
- Error responses missing exception message details HOT 7
- Don't set `format` when parsing parameters HOT 4
- Move more tests here HOT 2
- Attribute text not support in generator HOT 1
- Unable to override resource or controller templates
- Sideloads randomly stop getting included in responses
- Custom `:jsonapi` parameter_parsers being overriden by `graphiti-rails` HOT 2
- Deep Query Filter
- Convert path to string to avoid Graphiti::Errors::InvalidLink HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphiti-rails.