MCPcopy Index your code
hub / github.com/RustPython/RustPython / handle_error

Method handle_error

crates/common/src/encodings.rs:66–78  ·  view source on GitHub ↗
(
        &mut self,
        errors: &E,
        byte_range: Range<usize>,
        reason: Option<&str>,
    )

Source from the content-addressed store, hash-verified

64 fn error_decoding(&self, byte_range: Range<usize>, reason: Option<&str>) -> Self::Error;
65
66 fn handle_error<E>(
67 &mut self,
68 errors: &E,
69 byte_range: Range<usize>,
70 reason: Option<&str>,
71 ) -> Result<Self::StrBuf, Self::Error>
72 where
73 E: DecodeErrorHandler<Self>,
74 {
75 let (replace, restart) = errors.handle_decode_error(self, byte_range, reason)?;
76 self.restart_from(restart)?;
77 Ok(replace)
78 }
79}
80
81pub trait EncodeErrorHandler<Ctx: EncodeContext> {

Callers

nothing calls this directly

Implementers 1

codecs.rscrates/vm/src/codecs.rs

Calls 2

restart_fromMethod · 0.80
handle_decode_errorMethod · 0.45

Tested by

no test coverage detected