don't send stack errors
This commit is contained in:
@@ -212,11 +212,7 @@ const main = async () => {
|
|||||||
await userMap.subscribe();
|
await userMap.subscribe();
|
||||||
const userStatsMap = new UserStatsMap(driftClient, {
|
const userStatsMap = new UserStatsMap(driftClient, {
|
||||||
type: 'polling',
|
type: 'polling',
|
||||||
accountLoader: new BulkAccountLoader(
|
accountLoader: new BulkAccountLoader(connection, stateCommitment, 0),
|
||||||
connection,
|
|
||||||
stateCommitment,
|
|
||||||
0
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
await userStatsMap.subscribe();
|
await userStatsMap.subscribe();
|
||||||
|
|
||||||
|
|||||||
@@ -131,11 +131,20 @@ async function main() {
|
|||||||
ws.send(
|
ws.send(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
channel: requestChannel,
|
channel: requestChannel,
|
||||||
error: error.message,
|
error:
|
||||||
|
'Error subscribing to channel with data: ' +
|
||||||
|
JSON.stringify(parsedMessage),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
ws.close(1003, JSON.stringify({ error: error.message }));
|
ws.close(
|
||||||
|
1003,
|
||||||
|
JSON.stringify({
|
||||||
|
error:
|
||||||
|
'Error subscribing to channel with data: ' +
|
||||||
|
JSON.stringify(parsedMessage),
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -189,14 +198,24 @@ async function main() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
const requestChannel = safeGetRawChannelFromMessage(parsedMessage);
|
const requestChannel = safeGetRawChannelFromMessage(parsedMessage);
|
||||||
if (requestChannel) {
|
if (requestChannel) {
|
||||||
|
console.log('Error unsubscribing from channel:', error.message);
|
||||||
ws.send(
|
ws.send(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
channel: requestChannel,
|
channel: requestChannel,
|
||||||
error: error.message,
|
error:
|
||||||
|
'Error unsubscribing from channel with data: ' +
|
||||||
|
JSON.stringify(parsedMessage),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
ws.close(1003, JSON.stringify({ error: error.message }));
|
ws.close(
|
||||||
|
1003,
|
||||||
|
JSON.stringify({
|
||||||
|
error:
|
||||||
|
'Error unsubscribing from channel with data: ' +
|
||||||
|
JSON.stringify(parsedMessage),
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user