#[non_exhaustive]pub enum SessionError {
Show 14 variants
InvalidState {
expected: Vec<SessionState>,
current: SessionState,
},
EnvironmentScriptFailed {
name: String,
action: String,
reason: String,
},
FormatString {
context: String,
reason: String,
},
EmbeddedFile {
name: String,
source: Error,
},
EmbeddedFilePath {
name: String,
filename: String,
reason: String,
},
WorkingDirectory {
path: PathBuf,
source: Error,
},
SubprocessStart {
command: String,
source: Error,
},
TempDir {
path: PathBuf,
source: Error,
},
Runtime(String),
DuplicateEnvironment {
id: String,
},
UnknownEnvironment {
identifier: String,
},
PathPermissions {
path: String,
reason: String,
},
HelperCommunication(String),
LifoViolation {
expected: String,
got: String,
},
}Expand description
Errors that can occur during session operations.
use openjd_sessions::SessionError;
let err = SessionError::Runtime("something went wrong".into());
assert_eq!(err.to_string(), "something went wrong");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidState
Session is not in the expected state for the requested operation.
EnvironmentScriptFailed
An environment’s onEnter or onExit script failed.
FormatString
Failed to resolve a format string expression.
EmbeddedFile
Failed to write an embedded file.
EmbeddedFilePath
An embedded file’s filename is not a safe single path component.
Raised when a filename field’s value contains path separators,
parent-directory components, null bytes, or is otherwise unsafe.
This is a defense-in-depth check; openjd-model also rejects
path separators in filenames at template validation time per the
2023-09 spec (§6.1.1 <Filename>).
WorkingDirectory
Failed to create or access the working directory.
SubprocessStart
Subprocess failed to start.
TempDir
Failed to create or manage a temp directory.
Runtime(String)
A generic runtime error.
DuplicateEnvironment
Attempted to enter an environment that is already active in this session.
UnknownEnvironment
Referenced an environment identifier that does not exist in this session.
PathPermissions
Failed to set file ownership or permissions (chown/chmod).
HelperCommunication(String)
Cross-user helper IPC communication failure.
LifoViolation
Attempted to exit an environment out of LIFO order.
Trait Implementations§
Source§impl Debug for SessionError
impl Debug for SessionError
Source§impl Display for SessionError
impl Display for SessionError
Source§impl Error for SessionError
impl Error for SessionError
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()
Auto Trait Implementations§
impl Freeze for SessionError
impl !RefUnwindSafe for SessionError
impl Send for SessionError
impl Sync for SessionError
impl Unpin for SessionError
impl UnsafeUnpin for SessionError
impl !UnwindSafe for SessionError
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> 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>
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>
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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more