Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/oauth/src/install-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,10 @@ export class InstallProvider {
res.end(body);
}
} catch (e: unknown) {
const message = `An unhandled error occurred while processing an install path request (error: ${e})`;
const errorMessage = e instanceof Error ? e.message : String(e);
const message = `An unhandled error occurred while processing an install path request (error: ${errorMessage})`;
this.logger.error(message);
// biome-ignore lint/suspicious/noExplicitAny: errors can be any
throw new GenerateInstallUrlError((e as any).message);
throw new GenerateInstallUrlError(errorMessage);
}
}

Expand Down
7 changes: 6 additions & 1 deletion packages/web-api/src/WebClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,12 @@ export class WebClient extends Methods {
// if it isn't a Gzip response but is from the admin.analytics.getFile request,
// decode the ArrayBuffer to JSON read the error
const buffer = await response.arrayBuffer();
data = JSON.parse(new TextDecoder().decode(buffer));
try {
data = JSON.parse(new TextDecoder().decode(buffer));
} catch (_) {
// failed to parse the response body as JSON
data = { ok: false, error: new TextDecoder().decode(buffer) };
}
} else {
const text = await response.text();
try {
Expand Down
2 changes: 1 addition & 1 deletion packages/webhook/src/IncomingWebhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class IncomingWebhook {
timeout: 0,
},
) {
if (url === undefined) {
if (!url) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this PR is also a duplicate of your other PR, #2724. I will close the other one. In the future, do not spam our repo with multiple PRs for the same changes.

throw new Error('Incoming webhook URL is required');
}

Expand Down