| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
When no overload matches a call, the TypeError now carries the data its message is built from as attributes on the exception instance: _clr_method_name (snake_case method name), _clr_overload_signatures (tuple of formatted signatures) and _clr_overloads_hint (the rendered hint block appended to the message). Consumers such as Lean's exception interpreters can read these instead of parsing the message. The message itself is unchanged, and attribute attachment is best-effort: on any failure the plain TypeError with the same message is raised.
|
Paired Lean PR that consumes the structured attributes (with graceful fallback to message parsing): QuantConnect/Lean#9663 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What does this implement/fix? Explain your changes.
When a method call cannot be bound to any overload, the raised TypeError now carries the data its message is built from as attributes on the exception instance, so consumers can read them directly instead of parsing the message:
Each attribute is only present when the corresponding information is available. The human-readable message is byte-for-byte unchanged, so existing consumers that parse it (e.g. current Lean releases) keep working. Attribute attachment is best-effort: on any failure the plain TypeError with the same message is raised.
MethodSignatureFormatter.FormatOverloads is split into GetSignatures + FormatOverloadsHint so the binder can attach the same signature list the message shows; its output is unchanged.
Pairs with a Lean PR that makes NoMethodMatchPythonExceptionInterpreter prefer these attributes and fall back to message parsing (linked in comments below).
Does this close any currently open issues?
No open issue in this repo; part of the error-surface improvements from the fleet-evidence study (QuantConnect/Agents#305, improvement 1).
Any other comments?
The attribute names are defined as internal constants in Exceptions (BindFailure*Attribute). They are intentionally not public static fields: Exceptions.Initialize() resolves every public static field of that class against the builtins module at engine startup.
Checklist
Check all those that are applicable and complete.