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

Method throw

crates/wasm/src/js_module.rs:580–593  ·  view source on GitHub ↗
(
            &self,
            exc_type: PyObjectRef,
            exc_val: OptionalArg,
            exc_tb: OptionalArg,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

578
579 #[pymethod]
580 fn throw(
581 &self,
582 exc_type: PyObjectRef,
583 exc_val: OptionalArg,
584 exc_tb: OptionalArg,
585 vm: &VirtualMachine,
586 ) -> PyResult {
587 let err = vm.normalize_exception(
588 exc_type,
589 exc_val.unwrap_or_none(vm),
590 exc_tb.unwrap_or_none(vm),
591 )?;
592 Err(err)
593 }
594 }
595
596 impl SelfIter for AwaitPromise {}

Callers

nothing calls this directly

Calls 3

normalize_exceptionMethod · 0.80
ErrClass · 0.50
unwrap_or_noneMethod · 0.45

Tested by

no test coverage detected