Comments (2)
https://github.com/ntex-rs/examples/blob/master/json_error/src/main.rs
from ntex.
it looks like error_handler
:
fn main() {
let json_cfg = web::JsonConfig::default()
.limit(4096)
.content_type(|mime| mime == mime::TEXT_PLAIN)
// use custom error handler
.error_handler(|err, req| {
error::InternalError::from_response(err, HttpResponse::Conflict().into()).into()
});
App::new()
.app_data(json_cfg)
.service(index);
}
from ntex.
Related Issues (20)
- Handler hangs when processing upgrade request HOT 7
- ntex 0.5.27 suddenly run into CPU 100% HOT 48
- `cookie::Cookie<'_>` and `Cookie<'_>` have similar names, but are actually distinct types HOT 1
- WASI tokio ntex-rt implementation HOT 3
- how to set cors or allowed methods? HOT 4
- Server crashes when using glommio HOT 20
- Add support for monoio runtime HOT 6
- Documentation Site Down HOT 6
- Stopping `Server` does not release resources HOT 7
- Data race in `BytesMut` HOT 2
- Experiencing a timeout while uploading a large file HOT 10
- Add support (or example) auto-generation OpenAPI + SwaggerUI or alternatives HOT 2
- async_oneshot get yunked HOT 1
- Add try_join to ntex_utils HOT 4
- Websocket benchmark
- Website produces invalid cert warning HOT 2
- SSE integration HOT 6
- How to access state in middleware? HOT 1
- Arbiter constructor for glommio CPU pinning HOT 1
- Set a cookie doctest fails at runtime with async-std, but passes with tokio. HOT 2
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 ntex.