pub enum FoundryLocalError {
Native {
code: NativeErrorCode,
message: String,
},
LibraryLoad {
reason: String,
},
CommandExecution {
reason: String,
},
InvalidConfiguration {
reason: String,
},
ModelOperation {
reason: String,
},
HttpRequest(Error),
Serialization(Error),
Validation {
reason: String,
},
Io(Error),
Internal {
reason: String,
},
}Expand description
Errors that can occur when using the Foundry Local SDK.
Variants§
Native
The native core library returned an error.
LibraryLoad
The native core library could not be loaded.
CommandExecution
A command executed against the native core returned an error.
InvalidConfiguration
The provided configuration is invalid.
ModelOperation
A model operation failed (load, unload, download, etc.).
HttpRequest(Error)
An HTTP request to the external service failed.
Serialization(Error)
Serialization or deserialization of JSON data failed.
Validation
A validation check on user-supplied input failed.
Io(Error)
An I/O error occurred.
Internal
An internal SDK error (e.g. poisoned lock).
Implementations§
Source§impl FoundryLocalError
impl FoundryLocalError
Sourcepub fn native_code(&self) -> Option<NativeErrorCode>
pub fn native_code(&self) -> Option<NativeErrorCode>
Returns the native error code, if this error originated in the native library.
Sourcepub fn native_message(&self) -> Option<&str>
pub fn native_message(&self) -> Option<&str>
Returns the native error message, if this error originated in the native library.
Trait Implementations§
Source§impl Debug for FoundryLocalError
impl Debug for FoundryLocalError
Source§impl Display for FoundryLocalError
impl Display for FoundryLocalError
Source§impl Error for FoundryLocalError
impl Error for FoundryLocalError
Source§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 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for FoundryLocalError
impl From<Error> for FoundryLocalError
Source§impl From<Error> for FoundryLocalError
impl From<Error> for FoundryLocalError
Auto Trait Implementations§
impl !RefUnwindSafe for FoundryLocalError
impl !UnwindSafe for FoundryLocalError
impl Freeze for FoundryLocalError
impl Send for FoundryLocalError
impl Sync for FoundryLocalError
impl Unpin for FoundryLocalError
impl UnsafeUnpin for FoundryLocalError
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