Skip to content

Commit

Permalink
feat: log webhook timeout in DEBUG mode (#615)
Browse files Browse the repository at this point in the history
grammY already throws an error in these cases,
but sometimes, people don't put their errors in
the logs. This will fix that.
  • Loading branch information
KnorpelSenf authored Jul 30, 2024
1 parent 31d0ba9 commit 4256e4f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/convenience/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ function timeoutIfNecessary(
if (timeout === Infinity) return task;
return new Promise((resolve, reject) => {
const handle = setTimeout(() => {
debugErr(`Request timed out after ${timeout} ms`);
if (onTimeout === "throw") {
reject(new Error(`Request timed out after ${timeout} ms`));
} else {
Expand Down

0 comments on commit 4256e4f

Please sign in to comment.