diff --git a/src/stores/ftbot.ts b/src/stores/ftbot.ts index c1b76a0c..a4628a4e 100644 --- a/src/stores/ftbot.ts +++ b/src/stores/ftbot.ts @@ -919,6 +919,9 @@ export function createBotSubStore(botId: string, botName: string) { _handleWebsocketMessage(ws, event: MessageEvent) { const msg: FTWsMessage = JSON.parse(event.data); switch (msg.type) { + case FtWsMessageTypes.exception: + showAlert(`WSException: ${msg.data}`, 'danger'); + break; case FtWsMessageTypes.whitelist: this.whitelist = msg.data; break; diff --git a/src/types/wsMessageTypes.ts b/src/types/wsMessageTypes.ts index b17c9a76..3fe1ecc9 100644 --- a/src/types/wsMessageTypes.ts +++ b/src/types/wsMessageTypes.ts @@ -1,4 +1,6 @@ export enum FtWsMessageTypes { + exception = 'exception', + whitelist = 'whitelist', entryFill = 'entry_fill', entryCancel = 'entry_cancel', @@ -56,7 +58,13 @@ export interface FtNewCandleMessage extends FtBaseWsMessage { // ... } +export interface FtErrorMessage extends FtBaseWsMessage { + type: FtWsMessageTypes.exception; + data: string; +} + export type FTWsMessage = + | FtErrorMessage | FtWhitelistMessage | FtEntryFillMessage | FTEntryCancelMessage