pub struct ReportError {
pub code: ErrorCode,
pub kind: Option<ProviderErrorKind>,
pub context: Option<String>,
pub message: String,
}Expand description
A structured error, emitted as the --format json / json-stream output
when a skilltest run cannot produce a Report.
This is the machine-readable counterpart to the human hint the CLI prints on
stderr: it rides on stdout so SDK/plugin consumers get the ProviderErrorKind
(and the code/context) for targeted handling — retry on
ProviderErrorKind::Timeout, fail fast on ProviderErrorKind::Auth —
instead of matching substrings in the message. For json the object is
emitted bare; for json-stream it is the terminal
{"type":"error","error":{…}} line.
Fields§
§code: ErrorCodeThe coarse failure class, matching the process exit code.
kind: Option<ProviderErrorKind>The structured provider-failure category, when skilltest could classify it. Absent for usage errors and for unclassified provider failures.
context: Option<String>The provider context the failure came from (e.g. oneharness:claude-code,
api-judge). Absent for usage errors.
message: StringA human-readable description of what went wrong (the same text printed on stderr, minus the suggested-action hint).
Implementations§
Source§impl ReportError
impl ReportError
Sourcepub fn from_error(err: &Error) -> Self
pub fn from_error(err: &Error) -> Self
Build the structured error for a core Error. The mapping mirrors the
CLI’s error→exit-code mapping (report_error): Error::Provider is a
provider failure carrying its kind/context; everything else is a
usage error.
Trait Implementations§
Source§impl Clone for ReportError
impl Clone for ReportError
Source§fn clone(&self) -> ReportError
fn clone(&self) -> ReportError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReportError
impl Debug for ReportError
Source§impl<'de> Deserialize<'de> for ReportError
impl<'de> Deserialize<'de> for ReportError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ReportError
Source§impl JsonSchema for ReportError
impl JsonSchema for ReportError
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for ReportError
impl PartialEq for ReportError
Source§fn eq(&self, other: &ReportError) -> bool
fn eq(&self, other: &ReportError) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ReportError
impl Serialize for ReportError
impl StructuralPartialEq for ReportError
Auto Trait Implementations§
impl Freeze for ReportError
impl RefUnwindSafe for ReportError
impl Send for ReportError
impl Sync for ReportError
impl Unpin for ReportError
impl UnsafeUnpin for ReportError
impl UnwindSafe for ReportError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.