mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 10:30:21 +00:00
refactor: dedupe extension string helpers
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { WebClient } from "@slack/web-api";
|
||||
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
||||
import { isRecord } from "openclaw/plugin-sdk/text-runtime";
|
||||
import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
|
||||
import { createSlackWebClient } from "./client.js";
|
||||
|
||||
export type SlackScopesResult = {
|
||||
@@ -71,8 +71,7 @@ function readError(payload: unknown): string | undefined {
|
||||
if (!isRecord(payload)) {
|
||||
return undefined;
|
||||
}
|
||||
const error = payload.error;
|
||||
return typeof error === "string" && error.trim() ? error.trim() : undefined;
|
||||
return normalizeOptionalString(payload.error);
|
||||
}
|
||||
|
||||
async function callSlack(
|
||||
|
||||
Reference in New Issue
Block a user