From 53debd5b88d4e3a44257b2528e9cef561da5bfe5 Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Fri, 31 Jan 2025 11:25:58 +0100 Subject: [PATCH 1/3] Improve few ingress errors --- crates/ingress-http/src/handler/error.rs | 4 ++-- crates/ingress-http/src/handler/invocation.rs | 2 +- crates/ingress-http/src/handler/workflow.rs | 2 +- crates/types/src/schema/openapi.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ingress-http/src/handler/error.rs b/crates/ingress-http/src/handler/error.rs index e38c68857..0ee505803 100644 --- a/crates/ingress-http/src/handler/error.rs +++ b/crates/ingress-http/src/handler/error.rs @@ -22,9 +22,9 @@ use std::string; pub(crate) enum HandlerError { #[error("not found")] NotFound, - #[error("service '{0}' not found")] + #[error("service '{0}' not found, make sure to register the service before calling it.")] ServiceNotFound(String), - #[error("service '{0}' handler '{1}' not found")] + #[error("the service '{0}' exists, but the handler '{1}' was not found, check that the handler exists in the latest registered service version.")] ServiceHandlerNotFound(String, String), #[error("invocation not found")] InvocationNotFound, diff --git a/crates/ingress-http/src/handler/invocation.rs b/crates/ingress-http/src/handler/invocation.rs index ce90cba24..2eff41af4 100644 --- a/crates/ingress-http/src/handler/invocation.rs +++ b/crates/ingress-http/src/handler/invocation.rs @@ -100,7 +100,7 @@ where .await? { AttachInvocationResponse::NotFound => { - return Err(HandlerError::NotFound); + return Err(HandlerError::InvocationNotFound); } AttachInvocationResponse::NotSupported => { return Err(HandlerError::NotImplemented); diff --git a/crates/ingress-http/src/handler/workflow.rs b/crates/ingress-http/src/handler/workflow.rs index 1706d726c..0e6679181 100644 --- a/crates/ingress-http/src/handler/workflow.rs +++ b/crates/ingress-http/src/handler/workflow.rs @@ -75,7 +75,7 @@ where .await? { AttachInvocationResponse::NotFound => { - return Err(HandlerError::NotFound); + return Err(HandlerError::InvocationNotFound); } AttachInvocationResponse::NotSupported => { return Err(HandlerError::NotImplemented); diff --git a/crates/types/src/schema/openapi.rs b/crates/types/src/schema/openapi.rs index 9f2758d51..fbaf44585 100644 --- a/crates/types/src/schema/openapi.rs +++ b/crates/types/src/schema/openapi.rs @@ -683,9 +683,9 @@ fn error_response_json_schema() -> Value { "type": "string", "title": "Error message" }, - "description": { + "stacktrace": { "type": "string", - "title": "Verbose error description" + "title": "Stacktrace of the error" } }, "required": ["message"], From f44037f895bdc261d0e2d2a15e7f1b44f24d5ae5 Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Fri, 31 Jan 2025 11:37:21 +0100 Subject: [PATCH 2/3] Little thing --- crates/invoker-impl/src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/invoker-impl/src/error.rs b/crates/invoker-impl/src/error.rs index 9efc82434..930a64396 100644 --- a/crates/invoker-impl/src/error.rs +++ b/crates/invoker-impl/src/error.rs @@ -399,11 +399,11 @@ impl fmt::Display for SdkInvocationErrorV2 { if let Some(related_command) = &self.related_command { if related_command.command_was_commited { - write!(f, "This error originated after executing {related_command}")?; + write!(f, "> This error originated after executing {related_command}")?; } else { write!( f, - "This error originated while processing {related_command}" + "> This error originated while processing {related_command}" )?; } } From 3804c69669eadb6ea42865b2854fa4f1e05b75c7 Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Fri, 31 Jan 2025 11:43:07 +0100 Subject: [PATCH 3/3] Little thing --- crates/invoker-impl/src/error.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/invoker-impl/src/error.rs b/crates/invoker-impl/src/error.rs index 930a64396..bb441b1f6 100644 --- a/crates/invoker-impl/src/error.rs +++ b/crates/invoker-impl/src/error.rs @@ -399,7 +399,10 @@ impl fmt::Display for SdkInvocationErrorV2 { if let Some(related_command) = &self.related_command { if related_command.command_was_commited { - write!(f, "> This error originated after executing {related_command}")?; + write!( + f, + "> This error originated after executing {related_command}" + )?; } else { write!( f,