mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 22:42:52 +00:00
chore(lint): enable stricter error rules
This commit is contained in:
@@ -112,7 +112,6 @@ export function resolveFeishuGroupSession(params: {
|
||||
})
|
||||
: buildFeishuConversationId({ chatId, scope: "group_sender", senderOpenId });
|
||||
break;
|
||||
case "group":
|
||||
default:
|
||||
peerId = chatId;
|
||||
break;
|
||||
|
||||
@@ -918,7 +918,7 @@ export async function handleFeishuMessage(params: {
|
||||
replyToMessageId: replyTargetMessageId,
|
||||
replyInThread: isGroup ? (groupSession?.replyInThread ?? false) : false,
|
||||
accountId: account.accountId,
|
||||
}).catch((err) => {
|
||||
}).catch((err: unknown) => {
|
||||
log(`feishu[${account.accountId}]: failed to send ACP init error reply: ${String(err)}`);
|
||||
});
|
||||
return;
|
||||
|
||||
@@ -37,7 +37,6 @@ export function buildFeishuConversationId(params: {
|
||||
return `${chatId}:topic:${topicId}`;
|
||||
}
|
||||
return senderOpenId ? `${chatId}:sender:${senderOpenId}` : chatId;
|
||||
case "group":
|
||||
default:
|
||||
return chatId;
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ function registerEventHandlers(
|
||||
const error = runtime?.error ?? console.error;
|
||||
const runFeishuHandler = async (params: { task: () => Promise<void>; errorMessage: string }) => {
|
||||
if (fireAndForget) {
|
||||
void params.task().catch((err) => {
|
||||
void params.task().catch((err: unknown) => {
|
||||
error(`${params.errorMessage}: ${String(err)}`);
|
||||
});
|
||||
return;
|
||||
@@ -417,7 +417,7 @@ function registerEventHandlers(
|
||||
accountId,
|
||||
});
|
||||
if (fireAndForget) {
|
||||
promise.catch((err) => {
|
||||
promise.catch((err: unknown) => {
|
||||
error(`feishu[${accountId}]: error handling card action: ${String(err)}`);
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -138,7 +138,7 @@ export function createFeishuBotMenuHandler(params: {
|
||||
}
|
||||
return await handleLegacyMenu();
|
||||
})
|
||||
.catch(async (err) => {
|
||||
.catch(async (err: unknown) => {
|
||||
if (isFeishuRetryableSyntheticEventError(err)) {
|
||||
await forgetProcessedFeishuMessage(syntheticMessageId, accountId, log);
|
||||
} else {
|
||||
@@ -150,7 +150,7 @@ export function createFeishuBotMenuHandler(params: {
|
||||
releaseFeishuMessageProcessing(syntheticMessageId, accountId);
|
||||
});
|
||||
if (fireAndForget) {
|
||||
promise.catch((err) => {
|
||||
promise.catch((err: unknown) => {
|
||||
error(`feishu[${accountId}]: error handling bot menu event: ${String(err)}`);
|
||||
});
|
||||
return;
|
||||
|
||||
@@ -35,7 +35,7 @@ export function createFeishuDriveCommentNoticeHandler(params: {
|
||||
const getBotOpenId = params.getBotOpenId ?? ((id) => botOpenIds.get(id));
|
||||
|
||||
const runFeishuHandler = async (task: () => Promise<void>) => {
|
||||
const promise = task().catch((err) => {
|
||||
const promise = task().catch((err: unknown) => {
|
||||
error(`feishu[${accountId}]: error handling drive comment notice: ${String(err)}`);
|
||||
});
|
||||
if (!fireAndForget) {
|
||||
|
||||
@@ -331,7 +331,7 @@ async function resolveParsedCommentContent(params: {
|
||||
resolvedObjToken: objToken,
|
||||
};
|
||||
})
|
||||
.catch((error) => {
|
||||
.catch((error: unknown) => {
|
||||
params.logger?.(
|
||||
`feishu[${params.accountId}]: wiki link resolution threw token=${link.wikiNodeToken} error=${formatErrorMessage(error)}`,
|
||||
);
|
||||
@@ -485,7 +485,7 @@ async function requestFeishuOpenApi<T>(params: {
|
||||
{ timeoutMs: params.timeoutMs },
|
||||
)
|
||||
.then((resolved) => (resolved.status === "resolved" ? resolved.value : null))
|
||||
.catch((error) => {
|
||||
.catch((error: unknown) => {
|
||||
params.logger?.(`${params.errorLabel}: ${formatErrorDetails(error)}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -329,7 +329,7 @@ export function createFeishuMessageReceiveHandler({
|
||||
await inboundDebouncer.enqueue(event);
|
||||
};
|
||||
if (fireAndForget) {
|
||||
void processMessage().catch((err) => {
|
||||
void processMessage().catch((err: unknown) => {
|
||||
releaseFeishuMessageProcessing(messageDedupeKey, accountId);
|
||||
error(`feishu[${accountId}]: error handling message: ${String(err)}`);
|
||||
});
|
||||
|
||||
@@ -79,7 +79,7 @@ async function waitForSlowBodyTimeoutResponse(
|
||||
socket.setEncoding("utf8");
|
||||
socket.on("error", () => {});
|
||||
socket.on("data", (chunk) => {
|
||||
response += chunk;
|
||||
response += chunk.toString();
|
||||
if (response.includes("Request body timeout")) {
|
||||
clearTimeout(failTimer);
|
||||
socket.destroy();
|
||||
@@ -127,7 +127,7 @@ async function waitForOversizedBodyResponse(url: string): Promise<string> {
|
||||
|
||||
socket.setEncoding("utf8");
|
||||
socket.on("data", (chunk) => {
|
||||
response += chunk;
|
||||
response += chunk.toString();
|
||||
if (response.includes("Payload too large")) {
|
||||
finish(response);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ function resolveFeishuParentConversationCandidates(rawId: string): string[] {
|
||||
case "group_topic":
|
||||
case "group_sender":
|
||||
return [parsed.chatId];
|
||||
case "group":
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ export class FeishuStreamingSession {
|
||||
.then(async ({ release }) => {
|
||||
await release();
|
||||
})
|
||||
.catch((e) => this.log?.(`Note update failed: ${String(e)}`));
|
||||
.catch((e: unknown) => this.log?.(`Note update failed: ${String(e)}`));
|
||||
}
|
||||
|
||||
async close(finalText?: string, options?: { note?: string }): Promise<boolean> {
|
||||
@@ -584,7 +584,7 @@ export class FeishuStreamingSession {
|
||||
.then(async ({ release }) => {
|
||||
await release();
|
||||
})
|
||||
.catch((e) => this.log?.(`Close failed: ${String(e)}`));
|
||||
.catch((e: unknown) => this.log?.(`Close failed: ${String(e)}`));
|
||||
const finalState = this.state;
|
||||
this.state = null;
|
||||
this.pendingText = null;
|
||||
|
||||
Reference in New Issue
Block a user