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

Function raise_exception

crates/stdlib/src/_sqlite3.rs:3490–3506  ·  view source on GitHub ↗
(
        typ: PyTypeRef,
        errcode: c_int,
        msg: String,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

3488 }
3489
3490 fn raise_exception(
3491 typ: PyTypeRef,
3492 errcode: c_int,
3493 msg: String,
3494 vm: &VirtualMachine,
3495 ) -> PyBaseExceptionRef {
3496 let dict = vm.ctx.new_dict();
3497 if let Err(e) = dict.set_item("sqlite_errorcode", vm.ctx.new_int(errcode).into(), vm) {
3498 return e;
3499 }
3500 let errname = name_from_errcode(errcode);
3501 if let Err(e) = dict.set_item("sqlite_errorname", vm.ctx.new_str(errname).into(), vm) {
3502 return e;
3503 }
3504
3505 vm.new_exception_msg_dict(typ, msg.into(), dict)
3506 }
3507
3508 static BEGIN_STATEMENTS: &[&[u8]] = &[
3509 b"BEGIN ",

Callers 2

error_extendedMethod · 0.85

Calls 6

name_from_errcodeFunction · 0.85
new_dictMethod · 0.80
set_itemMethod · 0.45
new_intMethod · 0.45
new_strMethod · 0.45

Tested by 1