-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance Remote Runtime Errors #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "#143-enhance-remote-runtime-errors\u00DC"
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -38,20 +38,28 @@ impl RemoteRuntime for RemoteNatsClient { | |||||||||||
| let message = match res { | ||||||||||||
| Ok(r) => r, | ||||||||||||
| Err(err) => { | ||||||||||||
| return Err(RuntimeError::simple( | ||||||||||||
| log::error!( | ||||||||||||
| "RemoteRuntimeExeption: failed to handle NATS message: {}", | ||||||||||||
|
raphael-goetz marked this conversation as resolved.
|
||||||||||||
| err | ||||||||||||
| ); | ||||||||||||
| return Err(RuntimeError::simple_str( | ||||||||||||
| "RemoteRuntimeExeption", | ||||||||||||
| format!("Failed to handle NATS message {:?}", err), | ||||||||||||
| "Failed to recieve any response messages from a remote runtime.", | ||||||||||||
|
raphael-goetz marked this conversation as resolved.
Outdated
|
||||||||||||
| "Failed to recieve any response messages from a remote runtime.", | |
| &format!( | |
| "Failed to recieve any response messages from a remote runtime: {}", | |
| err | |
| ), |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,24 +26,33 @@ impl RemoteRuntime for RemoteNatsClient { | |
| ) -> Result<Value, RuntimeError> { | ||
| let topic = format!("action.{}.{}", remote_name, request.execution_identifier); | ||
| let payload = request.encode_to_vec(); | ||
| let res = self.client.request(topic, payload.into()).await; | ||
| let res = self.client.request(topic.clone(), payload.into()).await; | ||
| log::info!("Publishing to topic: {}", topic); | ||
|
raphael-goetz marked this conversation as resolved.
Outdated
|
||
| let message = match res { | ||
| Ok(r) => r, | ||
| Err(_) => { | ||
| Err(err) => { | ||
| log::error!( | ||
| "RemoteRuntimeExeption: failed to handle NATS message: {}", | ||
| err | ||
| ); | ||
|
Comment on lines
+33
to
+37
|
||
| return Err(RuntimeError::simple_str( | ||
| "RemoteRuntimeExeption", | ||
| "Failed to handle NATS message", | ||
| "Failed to recieve any response messages from a remote runtime.", | ||
|
raphael-goetz marked this conversation as resolved.
Outdated
|
||
| )); | ||
| } | ||
| }; | ||
|
|
||
| let decode_result = ExecutionResult::decode(message.payload); | ||
| let execution_result = match decode_result { | ||
| Ok(r) => r, | ||
| Err(_) => { | ||
| Err(err) => { | ||
| log::error!( | ||
| "RemoteRuntimeExeption: failed to decode NATS message: {}", | ||
| err | ||
| ); | ||
| return Err(RuntimeError::simple_str( | ||
| "RemoteRuntimeExeption", | ||
| "Failed to decode NATS message", | ||
| "Failed to read Remote Response", | ||
| )); | ||
| } | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as in taurus: the "Publishing to topic" log is emitted after awaiting the request and will be printed even when the request fails. Log before sending the request and you can remove the
topic.clone().