fix: show invalid nickname connection errors

This commit is contained in:
illusia committed 2026-09-13 08:08:40 +08:00
1 parent d13b3207a9
commit ef3e65ea0b
5 files changed
+22 -4

No files matched your search

+2
View File
@@ -5,6 +5,7 @@ import { TSClient } from "./ts-client.js";
import type { TeamSpeakProtocol } from "./teamspeak-adapter.js";
export type ProbeErrorCode =
| "INVALID_NICKNAME"
| "HOST_NOT_FOUND"
| "UNREACHABLE"
| "CONNECTION_REFUSED"
@@ -104,6 +105,7 @@ export function toProbeError(error: unknown, password = ""): TeamSpeakProbeError
}
const mapping: Record<WebSpeakErrorCode, ProbeErrorCode> = {
invalid_target: "INTERNAL_ERROR",
invalid_nickname: "INVALID_NICKNAME",
unreachable: "UNREACHABLE",
host_not_found: "HOST_NOT_FOUND",
connection_refused: "CONNECTION_REFUSED",