Struct ConfigApiError
pub struct ConfigApiError {
pub code: ConfigApiCode,
pub message: String,
pub path: Option<String>,
pub op_index: Option<usize>,
}Expand description
Structured error returned by the new HTTP CRUD endpoints and the zeroclaw config
subcommands they share infrastructure with.
Fields§
§code: ConfigApiCodeStable error code for programmatic matching.
message: StringHuman-readable message. Safe to render directly in dashboards / terminals.
path: Option<String>Property path the error pertains to, when applicable. Empty when the
error is whole-config (e.g. ReloadFailed).
op_index: Option<usize>Index into the JSON Patch operation array, when the error originated
from a specific op in a PATCH /api/config batch.
Implementations§
Source§impl ConfigApiError
impl ConfigApiError
pub fn new(code: ConfigApiCode, message: impl Into<String>) -> Self
pub fn with_path(self, path: impl Into<String>) -> Self
pub fn with_op_index(self, index: usize) -> Self
pub fn from_validation(err: Error) -> Self
Source§impl ConfigApiError
impl ConfigApiError
Sourcepub fn path_not_found(path: impl Into<String>) -> Self
pub fn path_not_found(path: impl Into<String>) -> Self
Convenience: a path_not_found error for the given path.
Sourcepub fn secret_test_forbidden(path: impl Into<String>) -> Self
pub fn secret_test_forbidden(path: impl Into<String>) -> Self
Convenience: a secret_test_forbidden error for the given path.
Sourcepub fn op_not_supported(op: impl Into<String>) -> Self
pub fn op_not_supported(op: impl Into<String>) -> Self
Convenience: an op_not_supported error.
Trait Implementations§
Source§impl Clone for ConfigApiError
impl Clone for ConfigApiError
Source§fn clone(&self) -> ConfigApiError
fn clone(&self) -> ConfigApiError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigApiError
impl Debug for ConfigApiError
Source§impl<'de> Deserialize<'de> for ConfigApiError
impl<'de> Deserialize<'de> for ConfigApiError
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ConfigApiError
impl Display for ConfigApiError
Source§impl Error for ConfigApiError
impl Error for ConfigApiError
1.30.0 · §fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · §fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl JsonSchema for ConfigApiError
impl JsonSchema for ConfigApiError
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for ConfigApiError
impl RefUnwindSafe for ConfigApiError
impl Send for ConfigApiError
impl Sync for ConfigApiError
impl Unpin for ConfigApiError
impl UnsafeUnpin for ConfigApiError
impl UnwindSafe for ConfigApiError
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more