#[non_exhaustive]pub enum SsgError {
Core(Error),
Io {
path: PathBuf,
source: Error,
},
PathTraversal {
path: PathBuf,
},
SymlinkForbidden {
path: PathBuf,
},
Validation {
field: String,
message: String,
},
Template(Error),
LlmEndpointUnreachable {
url: String,
source: Box<dyn Error + Send + Sync>,
},
LlmTimeout {
duration: Duration,
},
LlmInvalidResponse {
message: String,
},
}Expand description
Error variants for the main ssg library.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Core(Error)
Errors originating from the pure-logic compilation core.
Io
File I/O failure with context.
Fields
PathTraversal
Path traversal detected in configuration paths.
SymlinkForbidden
Symlinks are not allowed for security reasons.
Validation
Configuration field validation failure.
Fields
Template(Error)
Template engine rendering errors. Gated by template feature.
LlmEndpointUnreachable
The local LLM endpoint (Ollama, llama.cpp) could not be
reached. Surfaced from the ureq-backed LlmPlugin HTTP
path (issue #520) when the TCP connection is refused, the
host is unresolvable, or the transport layer fails before
the request is sent.
Fields
LlmTimeout
The local LLM call exceeded the configured llm.timeout_secs
budget before returning a response. Reported as a typed error
(issue #520) so callers can distinguish a slow model from a
genuine network outage. There is no zombie subprocess to
reap — the previous curl shellout has been removed.
LlmInvalidResponse
The LLM responded but the payload was not a well-formed JSON
generation response (missing the response field, non-UTF-8
body, malformed JSON, or HTTP non-2xx status code without a
usable error envelope). Surfaced from the ureq HTTP path
(issue #520).
Implementations§
Source§impl SsgError
impl SsgError
Sourcepub fn io(err: impl Into<Error>, path: impl Into<PathBuf>) -> Self
pub fn io(err: impl Into<Error>, path: impl Into<PathBuf>) -> Self
Converts a generic error and path context into an SsgError::Io variant.
§Examples
use ssg::SsgError;
use std::io;
use std::path::PathBuf;
let io_err = io::Error::other("oops");
let err = SsgError::io(io_err, "data/file.txt");
assert!(matches!(err, SsgError::Io { .. }));
assert!(format!("{err}").contains("data/file.txt"));Trait Implementations§
Source§impl Error for SsgError
impl Error for SsgError
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 !RefUnwindSafe for SsgError
impl !UnwindSafe for SsgError
impl Freeze for SsgError
impl Send for SsgError
impl Sync for SsgError
impl Unpin for SsgError
impl UnsafeUnpin for SsgError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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>
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 more