refactor(errors): normalize user-facing error messages
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
* - onError(errorMessage)
|
||||
*/
|
||||
import { getApiConfig } from "@/core/net/config/api_config";
|
||||
import { ExceptionHandler } from "@/core/errors";
|
||||
import { AppEnvUtil, Logger } from "@/utils";
|
||||
|
||||
const log = new Logger("ChatWebSocket");
|
||||
@@ -89,7 +90,9 @@ export class ChatWebSocket {
|
||||
};
|
||||
} catch (e) {
|
||||
logWebSocketError("✕ WS CONNECT FAILED", e);
|
||||
this.onError?.(e instanceof Error ? e.message : String(e));
|
||||
this.onError?.(
|
||||
ExceptionHandler.message(e, "WebSocket connection failed."),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user