mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 16:30:23 +00:00
refactor: dedupe channel runtime error formatting
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import * as dns from "node:dns";
|
||||
import type { TelegramNetworkConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
||||
import {
|
||||
createPinnedLookup,
|
||||
hasEnvHttpProxyConfigured,
|
||||
@@ -270,7 +271,7 @@ function createTelegramDispatcher(policy: PinnedDispatcherPolicy): {
|
||||
effectivePolicy: policy,
|
||||
};
|
||||
} catch (err) {
|
||||
const reason = err instanceof Error ? err.message : String(err);
|
||||
const reason = formatErrorMessage(err);
|
||||
throw new Error(`explicit proxy dispatcher init failed: ${reason}`, { cause: err });
|
||||
}
|
||||
}
|
||||
@@ -293,9 +294,7 @@ function createTelegramDispatcher(policy: PinnedDispatcherPolicy): {
|
||||
};
|
||||
} catch (err) {
|
||||
log.warn(
|
||||
`env proxy dispatcher init failed; falling back to direct dispatcher: ${
|
||||
err instanceof Error ? err.message : String(err)
|
||||
}`,
|
||||
`env proxy dispatcher init failed; falling back to direct dispatcher: ${formatErrorMessage(err)}`,
|
||||
);
|
||||
const directPolicy: PinnedDispatcherPolicy = {
|
||||
mode: "direct",
|
||||
|
||||
Reference in New Issue
Block a user