fidius-core::error Rust¶
Error types for the Fidius plugin framework.
Structs¶
fidius-core::error::PluginError¶
pub
Derives: Debug, Clone, Serialize, Deserialize, PartialEq
Error returned by plugin method implementations to signal business logic failures.
Serialized as bincode across the FFI boundary. The host deserializes
this from the output buffer when the FFI shim returns STATUS_PLUGIN_ERROR.
The details field is stored as a JSON string (not serde_json::Value)
because bincode cannot deserialize a free-form serde_json::Value
(it lacks deserialize_any). Storing it as a String keeps the error
struct bincode-compatible.
Fields¶
| Name | Type | Description |
|---|---|---|
code |
String |
Machine-readable error code (e.g., "INVALID_INPUT", "NOT_FOUND"). |
message |
String |
Human-readable error message. |
details |
Option < String > |
Optional structured details as a JSON string. |
Methods¶
new pub¶
Create a new PluginError without details.
Source
with_details pub¶
fn with_details (code : impl Into < String > , message : impl Into < String > , details : serde_json :: Value ,) -> Self
Create a new PluginError with structured details.
The serde_json::Value is serialized to a JSON string for storage.
Source
details_value pub¶
Parse the details field back into a serde_json::Value.
Returns None if details is absent or fails to parse.