Conversation
generall
commented
Jun 25, 2025
- fix error handling in inference
- fmt
This comment was marked as resolved.
This comment was marked as resolved.
| .map_err(|e| { | ||
| let error_body = e.to_string(); | ||
| StorageError::service_error(format!( | ||
| "Failed to send inference request to {url}: {e}, error details: {error_body}", |
There was a problem hiding this comment.
The idea if this string was to split it: return just generic error to UI and log the detailed message. Something like that:
log::error!("Inference request error: {e}");
StorageError::service_error("Inference request failed.")
|
|
||
| #[derive(Debug, Deserialize)] | ||
| struct InferenceError { | ||
| pub error: String, |
There was a problem hiding this comment.
it will be nice to add more control with inference communication. For example, it can return '429 Too Many Requests'. In this case instead of returning the error string will be better to add actionable point to provide a resolution of this error to our customer.
It could be pub retry_after: Option<u64>, field which will tell explicitly what to do with this error on the API level.
There was a problem hiding this comment.
This makes sense, but maybe better done in a separate PR
* fix error handling in inference * fmt * Update src/common/inference/service.rs --------- Co-authored-by: Tim Visée <tim+github@visee.me>