libero/gen_error
Types
pub type GenError {
CannotReadDir(path: String, cause: simplifile.FileError)
CannotReadFile(path: String, cause: simplifile.FileError)
CannotWriteFile(path: String, cause: simplifile.FileError)
CannotCreateDir(path: String, cause: simplifile.FileError)
ParseFailed(path: String, cause: glance.Error)
UnresolvedTypeModule(module_path: String, type_name: String)
TypeNotFound(module_path: String, type_name: String)
NoEndpointsFound(server_src: String)
DuplicateEndpoint(fn_name: String, modules: List(String))
}
Constructors
-
CannotReadDir(path: String, cause: simplifile.FileError) -
CannotReadFile(path: String, cause: simplifile.FileError) -
CannotWriteFile(path: String, cause: simplifile.FileError) -
CannotCreateDir(path: String, cause: simplifile.FileError) -
ParseFailed(path: String, cause: glance.Error) -
UnresolvedTypeModule(module_path: String, type_name: String) -
TypeNotFound(module_path: String, type_name: String) -
NoEndpointsFound(server_src: String) -
DuplicateEndpoint(fn_name: String, modules: List(String))
Values
pub fn error_box(
title title: String,
path path: String,
body_lines body_lines: List(String),
hint hint: option.Option(String),
) -> String
Format a structured error as the boxed message libero prints to the
terminal. title is the one-line headline, path is the source file
or context the error refers to (rendered after ┌─), body_lines
are the explanation lines (each prefixed with │), and hint is an
optional remediation tip rendered below a separator.
Used by both typed GenError rendering and the TOML parser to keep
every error in the codebase consistent without duplicating the box
drawing.
pub fn print_error(err: GenError) -> Nil