Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions extism/extism.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,10 @@ def cancel_handle(self):
return CancelHandle(_lib.extism_plugin_cancel_handle(self.plugin))

def _check_error(self, rc):
error = _lib.extism_plugin_error(self.plugin)
if error != _ffi.NULL:
raise Error(_ffi.string(error).decode())
if rc != 0:
error = _lib.extism_plugin_error(self.plugin)
if error != _ffi.NULL:
raise Error(_ffi.string(error).decode())
raise Error(f"Error code: {rc}")

def function_exists(self, name: str) -> bool:
Expand Down