mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 02:31:24 +00:00
refactor: dedupe core helper error formatting
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatErrorMessage } from "../../infra/errors.js";
|
||||
import { formatTimeAgo } from "../../infra/format-time/format-relative.ts";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../../terminal/table.js";
|
||||
@@ -99,7 +100,7 @@ function parseSinceMs(raw: unknown, label: string): number | undefined {
|
||||
try {
|
||||
return parseDurationMs(value);
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err);
|
||||
const message = formatErrorMessage(err);
|
||||
defaultRuntime.error(`${label}: ${message}`);
|
||||
defaultRuntime.exit(1);
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user