Skip to content

inference errors#6759

Merged
generall merged 3 commits intodevfrom
inference-errors
Jun 26, 2025
Merged

inference errors#6759
generall merged 3 commits intodevfrom
inference-errors

Conversation

@generall
Copy link
Member

  • fix error handling in inference
  • fmt

@generall generall requested a review from n0x29a June 25, 2025 18:37
@coderabbitai

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}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?


#[derive(Debug, Deserialize)]
struct InferenceError {
pub error: String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, but maybe better done in a separate PR

@generall generall merged commit 15a52a4 into dev Jun 26, 2025
18 checks passed
@generall generall deleted the inference-errors branch June 26, 2025 09:12
generall added a commit that referenced this pull request Jul 17, 2025
* fix error handling in inference

* fmt

* Update src/common/inference/service.rs

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
@coderabbitai coderabbitai bot mentioned this pull request Nov 25, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants