openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
33 lines (32 loc) • 960 B
JavaScript
import { p as shortenHomePath } from "./utils-C8YECn2Q.mjs";
import { t as formatErrorMessage } from "./errors-BKzCeTYb.mjs";
import { t as note } from "./note-CnLgHvug.mjs";
//#region src/commands/doctor-agent-database-operation.ts
/** Keep one unusable agent database from aborting sibling Doctor work. */
function runDoctorAgentDatabaseOperation(e) {
try {
return {
ok: true,
value: e.run()
};
} catch (t) {
noteDoctorAgentDatabaseFailure(e, t);
return { ok: false };
}
}
async function runDoctorAgentDatabaseOperationAsync(e) {
try {
return {
ok: true,
value: await e.run()
};
} catch (t) {
noteDoctorAgentDatabaseFailure(e, t);
return { ok: false };
}
}
function noteDoctorAgentDatabaseFailure(e, t) {
note(`- Agent ${e.agentId} database ${shortenHomePath(e.path)}: ${formatErrorMessage(t)}`, "Doctor warnings");
}
//#endregion
export { runDoctorAgentDatabaseOperationAsync as n, runDoctorAgentDatabaseOperation as t };