mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-17 00:31:34 +03:00
Better error descriptions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.18.4",
|
||||
"version": "0.18.5",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -373,9 +373,9 @@ class OrionAggregatorWS {
|
||||
const { id } = err;
|
||||
if (id !== undefined) {
|
||||
const subType = objectKeys(this.subscriptions).find((st) => this.subscriptions[st]?.[id]);
|
||||
if (subType === undefined) throw new Error('OrionAggregatorWS: cannot find subscription type by id');
|
||||
if (subType === undefined) throw new Error(`OrionAggregatorWS: cannot find subscription type by id ${id}. Current subscriptions: ${JSON.stringify(this.subscriptions)}`);
|
||||
const sub = this.subscriptions[subType]?.[id];
|
||||
if (sub === undefined) throw new Error('OrionAggregatorWS: cannot find subscription by id');
|
||||
if (sub === undefined) throw new Error(`OrionAggregatorWS: cannot find subscription by id ${id}. Current subscriptions: ${JSON.stringify(this.subscriptions)}`);
|
||||
if ('errorCb' in sub) {
|
||||
sub.errorCb(err.m);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user