Skip to content

v0.1.3

Compare
Choose a tag to compare
@ym-project ym-project released this 25 Aug 20:25
· 6 commits to v4 since this release

What's Changed

  • feat(#37): ✨ add error_handler config option by @ym-project in #39
    You can set error handler to overwrite default serde error:
    use actix_msgpack::MsgPackConfig;
    use actix_web::{HttpResponse, HttpServer, App, web::Data};
    
    #[actix_web::main]
    async fn main() {
       HttpServer::new(|| {
          let mut config = MsgPackConfig::default();
          config.error_handler(|err, _req| {
             InternalError::from_response(err, HttpResponse::BadRequest().finish()).into()
          });
    
          App::new().app_data(Data::new(config)).service(...)
       }
    }