Fixed macro bug
This commit is contained in:
parent
8cf7f3da93
commit
6a2aef3436
|
@ -183,7 +183,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "actix-web-utils"
|
||||
version = "0.2.4"
|
||||
version = "0.2.5"
|
||||
dependencies = [
|
||||
"actix-web",
|
||||
"log",
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
[package]
|
||||
name = "actix-web-utils"
|
||||
version = "0.2.4"
|
||||
version = "0.2.5"
|
||||
edition = "2021"
|
||||
authors = ["Franklin E. Blanco"]
|
||||
description = "Just some useful addons for actix web."
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/franklinblanco/actix-web-utils"
|
||||
|
||||
[lib]
|
||||
|
||||
|
|
|
@ -10,19 +10,19 @@ macro_rules! unwrap_or_return_handled_error {
|
|||
( $e:expr ) => {
|
||||
match $e {
|
||||
Ok(value) => value,
|
||||
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(error, 500)
|
||||
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(&error, 500)
|
||||
}
|
||||
};
|
||||
( $error_status_code:literal, $e:expr ) => {
|
||||
match $e {
|
||||
Ok(value) => value,
|
||||
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(error, error_status_code)
|
||||
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(&error, error_status_code)
|
||||
}
|
||||
};
|
||||
( $error_status_code:literal, $success_status_code:literal, $e:expr) => {
|
||||
match $e {
|
||||
Ok(value) => return actix_web_utils::typed_response::TypedHttpResponse::return_standard_response($success_status_code, value),
|
||||
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(error, error_status_code)
|
||||
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(&error, error_status_code)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue