Skip to main content

Module error

Module error 

Source
Expand description

Bridge Python exceptions into fidius’s PluginError.

Every Python exception raised by plugin code crosses this helper on its way back to the host. The mapping rules are:

  • code ← the exception class name (e.g. "ValueError", "KeyError").
  • messagestr(exc) — the user-facing message Python produced.
  • details ← a JSON-encoded object containing the formatted traceback (and, in later tasks, any structured fields a fidius.PluginError raise carried).

This file deliberately stays minimal: later tasks (FIDIUS-T-0086, FIDIUS-T-0089) extend it with fidius.PluginError-aware unwrapping so plugin code can raise typed errors without their fields being flattened.

Functions§

pyerr_to_plugin_error
Convert a PyErr into a PluginError, preserving class name, message, and a formatted traceback in details.