amplitude / Amplitude-Node

Server-side Node.js SDK for Amplitude
MIT License
67 stars 20 forks source link

Make it possible to identify and catch timeout exceptions #93

Open HeeL opened 3 years ago

HeeL commented 3 years ago

Summary

The way timeout exceptions are thrown make it not possible to catch them explicitly as its just a generic rejections with an empty new Error():

https://github.com/amplitude/Amplitude-Node/blob/main/packages/utils/src/queue.ts#L56

Motivations

Filter timeout exceptions and being able to handle them specifically

t0mstah commented 3 years ago

+1. Facing same problem. Never saw this error before, but seeing it now.