MCPcopy Create free account
hub / github.com/BerriAI/litellm / python_error

Function python_error

litellm-rust/crates/python-bridge/src/secrets/error.rs:89–95  ·  view source on GitHub ↗

The exception a Python secret manager raised anywhere in the chain, so a route surfaces it unchanged instead of wrapping it.

(
    py: Python<'_>,
    error: &(dyn std::error::Error + 'static),
)

Source from the content-addressed store, hash-verified

87/// The exception a Python secret manager raised anywhere in the chain, so a route surfaces it
88/// unchanged instead of wrapping it.
89pub(crate) fn python_error(
90 py: Python<'_>,
91 error: &(dyn std::error::Error + 'static),
92) -> Option<PyErr> {
93 litellm_error::find::<PythonSecretError>(error)
94 .map(|error| PyErr::from_value(error.0.clone_ref(py).into_bound(py).into_any()))
95}

Calls 2

clone_refMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected