Gap
Two related divergences between the core error hierarchy and both SDK error hierarchies:
1. Class name: Core exports NotFound; both SDKs export NotFoundError.
2. Inheritance chain: In core, OrderNotFound, MarketNotFound, and EventNotFound extend BaseError directly — NOT NotFound. In both SDKs, those three classes extend NotFoundError. This means instanceof NotFound in core does not catch OrderNotFound/MarketNotFound/EventNotFound, but isinstance(e, NotFoundError) in both SDKs does catch all three.
Core
core/src/errors.ts:72
export class NotFound extends BaseError {
constructor(message: string, exchange?: string) {
super(message, 404, 'NOT_FOUND', false, exchange);
}
}
export class OrderNotFound extends BaseError { ... } // extends BaseError, NOT NotFound
export class MarketNotFound extends BaseError { ... } // extends BaseError, NOT NotFound
export class EventNotFound extends BaseError { ... } // extends BaseError, NOT NotFound
instanceof NotFound catches only generic 404s; the three typed subclasses are siblings under BaseError, not children of NotFound.
TypeScript SDK
sdks/typescript/pmxt/errors.ts:51,57,63,69
export class NotFoundError extends PmxtError { ... } // renamed
export class OrderNotFound extends NotFoundError { ... } // child of NotFoundError
export class MarketNotFound extends NotFoundError { ... } // child of NotFoundError
export class EventNotFound extends NotFoundError { ... } // child of NotFoundError
- Class exported as
NotFoundError, not NotFound.
- All three typed subclasses extend
NotFoundError, not PmxtError directly.
e instanceof NotFoundError catches OrderNotFound, MarketNotFound, EventNotFound.
Python SDK
sdks/python/pmxt/errors.py:51,56,66,76
class NotFoundError(PmxtError): ... # renamed
class OrderNotFound(NotFoundError): ... # child of NotFoundError
class MarketNotFound(NotFoundError): ... # child of NotFoundError
class EventNotFound(NotFoundError): ... # child of NotFoundError
Same divergences as the TypeScript SDK.
Evidence
# Core uses NotFound
grep -n "class NotFound\b" core/src/errors.ts
# → line 72: export class NotFound extends BaseError
# Core typed subclasses extend BaseError directly
grep -n "class OrderNotFound\|class MarketNotFound\|class EventNotFound" core/src/errors.ts
# → extends BaseError (not NotFound)
# Both SDKs use NotFoundError
grep -rn "class NotFoundError\|class OrderNotFound\|class MarketNotFound\|class EventNotFound" \
sdks/typescript/pmxt/errors.ts sdks/python/pmxt/errors.py
# → TS: NotFoundError, OrderNotFound/MarketNotFound/EventNotFound extend NotFoundError
# → Py: same pattern
Impact
-
Class name mismatch: Any documentation, example, or user code written against the core that catches pmxt.NotFound will not compile/resolve against the SDK exports — the SDK only exports NotFoundError. Users porting code from core to SDK (or vice versa) must rename every catch clause.
-
Hierarchy mismatch: Code running against the core that writes catch (e) { if (e instanceof NotFound) { ... } } expecting to catch order/market/event not-found errors will silently miss them, because in core those classes extend BaseError directly. The same guard written against the SDKs works correctly. This creates subtly different runtime semantics between environments.
Found by automated Core-to-SDK surface coverage audit
Gap
Two related divergences between the core error hierarchy and both SDK error hierarchies:
1. Class name: Core exports
NotFound; both SDKs exportNotFoundError.2. Inheritance chain: In core,
OrderNotFound,MarketNotFound, andEventNotFoundextendBaseErrordirectly — NOTNotFound. In both SDKs, those three classes extendNotFoundError. This meansinstanceof NotFoundin core does not catchOrderNotFound/MarketNotFound/EventNotFound, butisinstance(e, NotFoundError)in both SDKs does catch all three.Core
core/src/errors.ts:72instanceof NotFoundcatches only generic 404s; the three typed subclasses are siblings underBaseError, not children ofNotFound.TypeScript SDK
sdks/typescript/pmxt/errors.ts:51,57,63,69NotFoundError, notNotFound.NotFoundError, notPmxtErrordirectly.e instanceof NotFoundErrorcatchesOrderNotFound,MarketNotFound,EventNotFound.Python SDK
sdks/python/pmxt/errors.py:51,56,66,76Same divergences as the TypeScript SDK.
Evidence
Impact
Class name mismatch: Any documentation, example, or user code written against the core that catches
pmxt.NotFoundwill not compile/resolve against the SDK exports — the SDK only exportsNotFoundError. Users porting code from core to SDK (or vice versa) must rename every catch clause.Hierarchy mismatch: Code running against the core that writes
catch (e) { if (e instanceof NotFound) { ... } }expecting to catch order/market/event not-found errors will silently miss them, because in core those classes extendBaseErrordirectly. The same guard written against the SDKs works correctly. This creates subtly different runtime semantics between environments.Found by automated Core-to-SDK surface coverage audit