Drift
TypeScript's PmxtError base class follows the standard JS Error idiom of setting this.name to the concrete subclass name in the constructor, so every error instance carries a .name property identifying its specific error class (e.g. "BadRequest", "OrderNotFound"). Python's PmxtError has no equivalent attribute — there is no self.name assignment anywhere in errors.py. A Python caller who wants the class name at runtime must use type(err).__name__ instead of a first-class attribute.
TypeScript SDK
sdks/typescript/pmxt/errors.ts:8-29 (PmxtError class), specifically line 20:
export class PmxtError extends Error {
...
constructor(message: string, code: string = "UNKNOWN_ERROR", retryable: boolean = false, exchange?: string) {
super(message);
this.name = this.constructor.name;
...
}
...
}
Every subclass (BadRequest, AuthenticationError, OrderNotFound, etc.) inherits this behavior via super(...), so err.name always equals the concrete subclass name at runtime — e.g. new OrderNotFound(...).name === "OrderNotFound".
Python SDK
sdks/python/pmxt/errors.py:13-27 (PmxtError class):
class PmxtError(Exception):
...
def __init__(self, message: str, code: str = "UNKNOWN_ERROR", retryable: bool = False, exchange: str | None = None) -> None:
...
def __str__(self) -> str:
parts = [self.message]
if self.exchange:
parts.append(f"[{self.exchange}]")
return " ".join(parts)
No self.name (or any equivalent) is ever assigned in __init__, and no subclass in errors.py sets one either (confirmed via grep — zero matches for self.name anywhere in the file). A Python PmxtError instance has no .name attribute at all; accessing err.name raises AttributeError.
Expected
Both SDKs should expose the same error-identification surface. Python's PmxtError.__init__ should set self.name = type(self).__name__ (or equivalent) so that err.name works identically in both languages, matching the documented cross-SDK error contract implied by the shared ERROR_CODE_MAP/_ERROR_CODE_MAP tables.
Impact
Code ported from TypeScript that does if err.name == "OrderNotFound": (a common idiomatic pattern for identifying a specific error subclass without importing every class) will raise AttributeError: 'OrderNotFound' object has no attribute 'name' in Python instead of behaving analogously. Logging/telemetry code that reads err.name for structured error reporting will also break silently when ported between the two SDKs.
Found by automated SDK cross-language drift audit
Drift
TypeScript's
PmxtErrorbase class follows the standard JSErroridiom of settingthis.nameto the concrete subclass name in the constructor, so every error instance carries a.nameproperty identifying its specific error class (e.g."BadRequest","OrderNotFound"). Python'sPmxtErrorhas no equivalent attribute — there is noself.nameassignment anywhere inerrors.py. A Python caller who wants the class name at runtime must usetype(err).__name__instead of a first-class attribute.TypeScript SDK
sdks/typescript/pmxt/errors.ts:8-29(PmxtErrorclass), specifically line 20:Every subclass (
BadRequest,AuthenticationError,OrderNotFound, etc.) inherits this behavior viasuper(...), soerr.namealways equals the concrete subclass name at runtime — e.g.new OrderNotFound(...).name === "OrderNotFound".Python SDK
sdks/python/pmxt/errors.py:13-27(PmxtErrorclass):No
self.name(or any equivalent) is ever assigned in__init__, and no subclass inerrors.pysets one either (confirmed via grep — zero matches forself.nameanywhere in the file). A PythonPmxtErrorinstance has no.nameattribute at all; accessingerr.nameraisesAttributeError.Expected
Both SDKs should expose the same error-identification surface. Python's
PmxtError.__init__should setself.name = type(self).__name__(or equivalent) so thaterr.nameworks identically in both languages, matching the documented cross-SDK error contract implied by the sharedERROR_CODE_MAP/_ERROR_CODE_MAPtables.Impact
Code ported from TypeScript that does
if err.name == "OrderNotFound":(a common idiomatic pattern for identifying a specific error subclass without importing every class) will raiseAttributeError: 'OrderNotFound' object has no attribute 'name'in Python instead of behaving analogously. Logging/telemetry code that readserr.namefor structured error reporting will also break silently when ported between the two SDKs.Found by automated SDK cross-language drift audit