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

Method result_exception

crates/stdlib/src/_sqlite3.rs:3341–3352  ·  view source on GitHub ↗
(self, vm: &VirtualMachine, exc: PyBaseExceptionRef, msg: &str)

Source from the content-addressed store, hash-verified

3339 }
3340
3341 fn result_exception(self, vm: &VirtualMachine, exc: PyBaseExceptionRef, msg: &str) {
3342 if exc.fast_isinstance(vm.ctx.exceptions.memory_error) {
3343 unsafe { sqlite3_result_error_nomem(self.ctx) }
3344 } else if exc.fast_isinstance(vm.ctx.exceptions.overflow_error) {
3345 unsafe { sqlite3_result_error_toobig(self.ctx) }
3346 } else {
3347 unsafe { sqlite3_result_error(self.ctx, msg.as_ptr().cast(), -1) }
3348 }
3349 if enable_traceback().load(Ordering::Relaxed) {
3350 vm.print_exception(exc);
3351 }
3352 }
3353
3354 fn db_handle(self) -> *mut sqlite3 {
3355 unsafe { sqlite3_context_db_handle(self.ctx) }

Callers 4

func_callbackMethod · 0.80
step_callbackMethod · 0.80
call_method_with_argsMethod · 0.80

Calls 6

enable_tracebackFunction · 0.85
fast_isinstanceMethod · 0.80
print_exceptionMethod · 0.80
castMethod · 0.45
as_ptrMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected