mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 19:35:28 -06:00
refactor: consolidate remaining coercion helpers (#122020)
This commit is contained in:
committed by
GitHub
parent
24bbb416b5
commit
cad77fb39c
@@ -1,4 +1,5 @@
|
||||
// Device pairing runtime commands for gateway and loopback-local fallback operations.
|
||||
import { coerceErrorMessage as normalizeErrorMessage } from "@openclaw/normalization-core/error-coercion";
|
||||
import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalString,
|
||||
@@ -275,13 +276,6 @@ async function findQueryPendingNodeApprovalNotices(
|
||||
);
|
||||
}
|
||||
|
||||
function normalizeErrorMessage(error: unknown): string {
|
||||
if (error instanceof Error) {
|
||||
return error.message;
|
||||
}
|
||||
return String(error);
|
||||
}
|
||||
|
||||
function isDevicePairingApprovalDenied(error: unknown): boolean {
|
||||
return normalizeLowercaseStringOrEmpty(normalizeErrorMessage(error)).includes(
|
||||
"device pairing approval denied",
|
||||
|
||||
Reference in New Issue
Block a user