mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 17:50:27 +00:00
fix(runtime): stabilize provider and channel runtime tests
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { formatErrorMessage } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
||||
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
||||
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
|
||||
|
||||
@@ -14,7 +13,6 @@ type TelegramApiLoggingParams<T> = {
|
||||
};
|
||||
|
||||
const fallbackLogger = createSubsystemLogger("telegram/api");
|
||||
const formatDanger = typeof danger === "function" ? danger : (message: string) => message;
|
||||
|
||||
function resolveTelegramApiLogger(runtime?: RuntimeEnv, logger?: TelegramApiLogger) {
|
||||
if (logger) {
|
||||
@@ -39,7 +37,7 @@ export async function withTelegramApiErrorLogging<T>({
|
||||
if (!shouldLog || shouldLog(err)) {
|
||||
const errText = formatErrorMessage(err);
|
||||
const log = resolveTelegramApiLogger(runtime, logger);
|
||||
log(formatDanger(`telegram ${operation} failed: ${errText}`));
|
||||
log(`telegram ${operation} failed: ${errText}`);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user