pub struct InferenceError {
pub error: Error,
pub body: String,
}Expand description
An Error together with the JSON error body an Inference JSON call
left behind, when there was one.
Unlike most *_json methods elsewhere in this crate, antfly_inference_*
calls are documented to always reset and fill their output buffer, even
on failure, with the runtime’s JSON error ({"error":...,"message":...})
– see the “Embedded inference without a database” block in
zig/pkg/antfly-embedded/include/antfly.h. This type carries that body forward
instead of discarding it; every buffer is freed (via antfly_buffer_free)
either way, whether the call succeeded or not.
Fields§
§error: Error§body: StringThe raw JSON error body, decoded as UTF-8 (lossy). Empty when the call never reached the runtime (for example, calling a closed handle) and so left no body to report.
Implementations§
Trait Implementations§
Source§impl Clone for InferenceError
impl Clone for InferenceError
Source§impl Debug for InferenceError
impl Debug for InferenceError
Source§impl Display for InferenceError
impl Display for InferenceError
impl Eq for InferenceError
Source§impl Error for InferenceError
impl Error for InferenceError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()