mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-22 11:05:17 +00:00
Add handling for websocket errors
This commit is contained in:
parent
014663bb66
commit
0bb0c6a69b
|
@ -919,6 +919,9 @@ export function createBotSubStore(botId: string, botName: string) {
|
|||
_handleWebsocketMessage(ws, event: MessageEvent<any>) {
|
||||
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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user