pub enum ExecutionError {
WithContext {
reason: String,
},
Generic {
reason: String,
backtrace: BackTrace,
},
DevicePoisoned {
reason: String,
},
}Expand description
An error that can happen when syncing a device.
Variants§
WithContext
A generic error happened during execution.
The backtrace and context information should be included in the reason string.
Generic
A generic error happened during execution thrown in the Burn project.
The full context isn’t captured by the string alone.
DevicePoisoned
The device is poisoned: a kernel faulted in a way the driver cannot recover from (an illegal memory access, a trap, a hardware fault).
Unlike the other variants, every later operation on the device fails: the process has to be restarted to use the device again.
Implementations§
Source§impl ExecutionError
impl ExecutionError
Sourcepub fn generic(reason: impl Into<String>) -> Self
pub fn generic(reason: impl Into<String>) -> Self
An error raised inside Burn, capturing where it was raised.
Capturing is cheap — a BackTrace resolves its frames only when it
is displayed — so this is the constructor to reach for by default.
Sourcepub fn with_context(reason: impl Into<String>) -> Self
pub fn with_context(reason: impl Into<String>) -> Self
An error from outside Burn, whose context the message already carries.
Sourcepub fn device_poisoned(reason: impl Into<String>) -> Self
pub fn device_poisoned(reason: impl Into<String>) -> Self
The device is poisoned, see ExecutionError::DevicePoisoned.
Sourcepub fn is_device_poisoned(&self) -> bool
pub fn is_device_poisoned(&self) -> bool
Whether the device from which the error originates is poisoned.
false means the operation that failed can be dropped or redone;
true means further operations on this device will fail.
Trait Implementations§
Source§impl Clone for ExecutionError
impl Clone for ExecutionError
Source§impl Debug for ExecutionError
impl Debug for ExecutionError
Source§impl<'de> Deserialize<'de> for ExecutionError
impl<'de> Deserialize<'de> for ExecutionError
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>,
Source§impl Display for ExecutionError
impl Display for ExecutionError
Source§impl Error for ExecutionError
impl Error for ExecutionError
1.30.0 · 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()