Skip to main content

Module error

Module error 

Source
Expand description

§Errors

Library code reports failures as Error values instead of panicking, so an application can recover or report the problem. Fallible public functions return Result. A failure that happens inside the run loop (a font that will not load while text is drawn, a texture the driver cannot create) has no caller to return to, so the engine delivers it as EngineEvent::Error and keeps running.

use pushrod::error::Error;

let error = Error::font("missing.ttf", "No such file");

assert_eq!(error.to_string(), "font \"missing.ttf\": No such file");

Enums§

Error
A failure reported by Pushrod or a backend.

Type Aliases§

Result
The result of a fallible Pushrod function.