Update to latest betas
This commit is contained in:
parent
a317f1eabe
commit
a745cdd1b4
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "actix-form-data"
|
||||
description = "Multipart Form Data for Actix Web"
|
||||
version = "0.6.0-beta.2"
|
||||
version = "0.6.0-beta.3"
|
||||
license = "GPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/Aardwolf/actix-form-data.git"
|
||||
|
@ -10,9 +10,9 @@ keywords = ["actix", "form-data", "multipart", "async"]
|
|||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-multipart = "0.4.0-beta.3"
|
||||
actix-multipart = "0.4.0-beta.5"
|
||||
actix-rt = "2.1.0"
|
||||
actix-web = "4.0.0-beta.4"
|
||||
actix-web = "4.0.0-beta.7"
|
||||
futures = "0.3.4"
|
||||
mime = "0.3.16"
|
||||
thiserror = "1.0"
|
||||
|
|
11
src/error.rs
11
src/error.rs
|
@ -24,10 +24,9 @@ use std::{
|
|||
|
||||
use actix_multipart::MultipartError;
|
||||
use actix_web::{
|
||||
dev::Body,
|
||||
error::{PayloadError, ResponseError},
|
||||
http::StatusCode,
|
||||
BaseHttpResponse,
|
||||
HttpResponse,
|
||||
};
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
|
@ -84,14 +83,14 @@ impl ResponseError for Error {
|
|||
}
|
||||
}
|
||||
|
||||
fn error_response(&self) -> BaseHttpResponse<Body> {
|
||||
fn error_response(&self) -> HttpResponse {
|
||||
match *self {
|
||||
Error::FileFn(ref e) => ResponseError::error_response(e.as_response_error()),
|
||||
Error::Payload(ref e) => ResponseError::error_response(e),
|
||||
Error::Multipart(_)
|
||||
| Error::ParseField(_)
|
||||
| Error::ParseInt(_)
|
||||
| Error::ParseFloat(_) => BaseHttpResponse::bad_request(),
|
||||
| Error::ParseFloat(_) => HttpResponse::BadRequest().finish(),
|
||||
Error::ContentType
|
||||
| Error::ContentDisposition
|
||||
| Error::Field
|
||||
|
@ -100,9 +99,9 @@ impl ResponseError for Error {
|
|||
| Error::FieldType
|
||||
| Error::Filename
|
||||
| Error::FileCount
|
||||
| Error::FileSize => BaseHttpResponse::bad_request(),
|
||||
| Error::FileSize => HttpResponse::BadRequest().finish(),
|
||||
Error::MissingMiddleware | Error::TxDropped => {
|
||||
BaseHttpResponse::internal_server_error()
|
||||
HttpResponse::InternalServerError().finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue