Type Error: "Property "sentryError" does not exist on type 'ILogger'
Ive extended the
@sapphire/plugin-logger
to add sentry logging, however it is still throwing type errors when I try to use said functions.
SentinelLogger.ts
SentryClient.TS
Reduced code for clarity
Usage:
Error:
https://i.imgur.com/PrA4R7b.pngSolution:Jump to solution
If you just want to send all your errors to sentry then you don't need to extend the logger, instead set it up like so: https://github.com/skyra-project/skyra/blob/main/src/Skyra.ts
Does that already help possibly?...
GitHub
skyra/src/Skyra.ts at main · skyra-project/skyra
A multipurpose Discord Bot designed to carry out most of your server's needs with great performance and stability. - skyra-project/skyra
5 Replies
Solution
If you just want to send all your errors to sentry then you don't need to extend the logger, instead set it up like so: https://github.com/skyra-project/skyra/blob/main/src/Skyra.ts
Does that already help possibly?
GitHub
skyra/src/Skyra.ts at main · skyra-project/skyra
A multipurpose Discord Bot designed to carry out most of your server's needs with great performance and stability. - skyra-project/skyra
If not then the answer is that you need to add module augmentation because nowhere do you tell TS that container.logger is a SentinelLogger
Will do this method instead!
Now will this also capture command related errors?
Yes
Well
It does for skyra at least
Top if my head not 100% sure if we have other stuff in place too
Might want to do a general code search for things like sentry and look through skyra's listeners
Looks like listener and tasks are the only two with specific sentry events, thanks.