mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 01:31:08 +00:00
fix: stabilize qa lab docker builds
This commit is contained in:
@@ -62,6 +62,7 @@ RUN corepack enable
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
|
||||
COPY openclaw.mjs ./
|
||||
COPY ui/package.json ./ui/package.json
|
||||
COPY patches ./patches
|
||||
COPY scripts/postinstall-bundled-plugins.mjs scripts/npm-runner.mjs scripts/windows-cmd-helpers.mjs ./scripts/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
||||
import { formatErrorMessage } from "./errors.js";
|
||||
import {
|
||||
type Bootstrap,
|
||||
type OutcomesEnvelope,
|
||||
|
||||
33
extensions/qa-lab/web/src/errors.ts
Normal file
33
extensions/qa-lab/web/src/errors.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
export function formatErrorMessage(err: unknown): string {
|
||||
if (err instanceof Error) {
|
||||
let formatted = err.message || err.name || "Error";
|
||||
let cause: unknown = err.cause;
|
||||
const seen = new Set<unknown>([err]);
|
||||
while (cause && !seen.has(cause)) {
|
||||
seen.add(cause);
|
||||
if (cause instanceof Error) {
|
||||
if (cause.message) {
|
||||
formatted += ` | ${cause.message}`;
|
||||
}
|
||||
cause = cause.cause;
|
||||
continue;
|
||||
}
|
||||
if (typeof cause === "string") {
|
||||
formatted += ` | ${cause}`;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return formatted;
|
||||
}
|
||||
if (typeof err === "string") {
|
||||
return err;
|
||||
}
|
||||
if (typeof err === "number" || typeof err === "boolean" || typeof err === "bigint") {
|
||||
return String(err);
|
||||
}
|
||||
try {
|
||||
return JSON.stringify(err);
|
||||
} catch {
|
||||
return Object.prototype.toString.call(err);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ RUN --mount=type=cache,id=openclaw-cleanup-smoke-apt-cache,target=/var/cache/apt
|
||||
|
||||
WORKDIR /repo
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
|
||||
COPY openclaw.mjs ./
|
||||
COPY ui/package.json ./ui/package.json
|
||||
COPY packages ./packages
|
||||
COPY extensions ./extensions
|
||||
|
||||
Reference in New Issue
Block a user