Open imsamdez opened 7 months ago
Hi @imsamdez,
Thank you for reaching out!
You can pass throwExceptions: true
option to make the library throw exceptions. You should be able to catch the errors then to prevent them from creating noise in your logs. Alternatively, you can use ignoreExceptions: true
option to make the library ignore errors.
Let me know if this would work for you. 🙏
// If true, errors when sending logs will be ignored
// Has precedence over throwExceptions
ignoreExceptions: false,
// If true, errors when sending logs will result in a thrown exception
throwExceptions: false,
https://github.com/logtail/logtail-js/blob/master/packages/core/src/base.ts#L39
I'm having a Forbidden error when I pause a source in BetterStack.
I tried to wrap my
logtail.debug
calls into atry/catch
or followed them with a.catch
but it seems that the error is happening in the core of your lib. By not being able to catch, it creates unnecessary noises in my logs files.Do you have any idea how to catch the error ?
Here is the error btw