MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / to_error

Function to_error

std/re/src/lib.rs:74–79  ·  view source on GitHub ↗

Routes engine errors to the matching host exception kind. */

(e: ReError)

Source from the content-addressed store, hash-verified

72
73 /* Routes engine errors to the matching host exception kind. */
74 fn to_error(e: ReError) -> Error {
75 match e {
76 ReError::Syntax(m) => Error::Value(m), // bad pattern is a ValueError
77 ReError::TooComplex(m) => Error::Runtime(m), // degradation is a RuntimeError
78 }
79 }
80
81 fn rx<T>(r: core::result::Result<T, ReError>) -> Result<T> {
82 r.map_err(to_error)

Callers 1

r#matchFunction · 0.85

Calls 1

ValueEnum · 0.50

Tested by

no test coverage detected