mirror of
https://github.com/fluencelabs/marine.git
synced 2025-03-15 05:50:49 +00:00
pr fixes
This commit is contained in:
parent
189a457dae
commit
536e4f365b
@ -18,9 +18,9 @@ use thiserror::Error;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum ItJsonSerdeError {
|
||||
#[error("cannot serialize IValues to Json: {0}")]
|
||||
#[error("{0}")]
|
||||
SerializationError(String),
|
||||
|
||||
#[error("cannot deserialize Json to IValues: {0}")]
|
||||
#[error("{0}")]
|
||||
DeserializationError(String),
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use it_json_serde::ItJsonSerdeError;
|
||||
use marine::MError;
|
||||
|
||||
use thiserror::Error;
|
||||
@ -54,19 +55,19 @@ pub enum FaaSError {
|
||||
NoSuchModule(String),
|
||||
|
||||
/// Provided arguments aren't compatible with a called function signature.
|
||||
#[error(r#"arguments from json deserialization error in module "{module_name}", function "{function_name}": {message}"#)]
|
||||
#[error(r#"arguments from json deserialization error in module "{module_name}", function "{function_name}": {error}"#)]
|
||||
JsonArgumentsDeserializationError {
|
||||
module_name: String,
|
||||
function_name: String,
|
||||
message: String,
|
||||
error: ItJsonSerdeError,
|
||||
},
|
||||
|
||||
/// Returned outputs aren't compatible with a called function signature.
|
||||
#[error(r#"output to json serialization error in module "{module_name}", function "{function_name}": {message}"#)]
|
||||
#[error(r#"output to json serialization error in module "{module_name}", function "{function_name}": {error}"#)]
|
||||
JsonOutputSerializationError {
|
||||
module_name: String,
|
||||
function_name: String,
|
||||
message: String,
|
||||
error: ItJsonSerdeError,
|
||||
},
|
||||
|
||||
/// Errors related to invalid config.
|
||||
@ -103,18 +104,18 @@ impl From<std::convert::Infallible> for FaaSError {
|
||||
macro_rules! json_to_faas_err {
|
||||
($json_expr:expr, $module_name:expr, $function_name:expr) => {
|
||||
$json_expr.map_err(|e| match e {
|
||||
it_json_serde::ItJsonSerdeError::SerializationError(message) => {
|
||||
it_json_serde::ItJsonSerdeError::SerializationError(_) => {
|
||||
FaaSError::JsonOutputSerializationError {
|
||||
module_name: $module_name,
|
||||
function_name: $function_name,
|
||||
message,
|
||||
error: e,
|
||||
}
|
||||
}
|
||||
it_json_serde::ItJsonSerdeError::DeserializationError(message) => {
|
||||
it_json_serde::ItJsonSerdeError::DeserializationError(_) => {
|
||||
FaaSError::JsonArgumentsDeserializationError {
|
||||
module_name: $module_name,
|
||||
function_name: $function_name,
|
||||
message,
|
||||
error: e,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use it_json_serde::ItJsonSerdeError;
|
||||
use crate::MError;
|
||||
|
||||
use thiserror::Error;
|
||||
@ -34,19 +35,19 @@ pub enum FaaSError {
|
||||
NoSuchModule(String),
|
||||
|
||||
/// Provided arguments aren't compatible with a called function signature.
|
||||
#[error(r#"arguments from json deserialization error in module "{module_name}", function "{function_name}": {message}"#)]
|
||||
#[error(r#"arguments from json deserialization error in module "{module_name}", function "{function_name}": {error}"#)]
|
||||
JsonArgumentsDeserializationError {
|
||||
module_name: String,
|
||||
function_name: String,
|
||||
message: String,
|
||||
error: ItJsonSerdeError,
|
||||
},
|
||||
|
||||
/// Returned outputs aren't compatible with a called function signature.
|
||||
#[error(r#"output to json serialization error in module "{module_name}", function "{function_name}": {message}"#)]
|
||||
#[error(r#"output to json serialization error in module "{module_name}", function "{function_name}": {error}"#)]
|
||||
JsonOutputSerializationError {
|
||||
module_name: String,
|
||||
function_name: String,
|
||||
message: String,
|
||||
error: ItJsonSerdeError,
|
||||
},
|
||||
|
||||
/// Errors related to invalid config.
|
||||
@ -74,18 +75,18 @@ impl From<std::convert::Infallible> for FaaSError {
|
||||
macro_rules! json_to_faas_err {
|
||||
($json_expr:expr, $module_name:expr, $function_name:expr) => {
|
||||
$json_expr.map_err(|e| match e {
|
||||
it_json_serde::ItJsonSerdeError::SerializationError(message) => {
|
||||
it_json_serde::ItJsonSerdeError::SerializationError(_) => {
|
||||
FaaSError::JsonOutputSerializationError {
|
||||
module_name: $module_name,
|
||||
function_name: $function_name,
|
||||
message,
|
||||
error: e,
|
||||
}
|
||||
}
|
||||
it_json_serde::ItJsonSerdeError::DeserializationError(message) => {
|
||||
it_json_serde::ItJsonSerdeError::DeserializationError(_) => {
|
||||
FaaSError::JsonArgumentsDeserializationError {
|
||||
module_name: $module_name,
|
||||
function_name: $function_name,
|
||||
message,
|
||||
error: e,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user