Catching Errors / Logging

#1

Hi,

I want to catch errors that occur on the server (in cloud or in the framework) so I can send them to our slack channel for immediate feedback. Whats the best way to go about it?

I have tried following this https://github.com/parse-community/parse-server/issues/1054 and adding a middleware but it doesnt seem to get called for some reason? I have tried looking through the source too to see if I can see where to do it but it isnt exactly obvious to me.

Any suggestions?

Cheers,
Mike

#2

Hi @mikecann,

I use a service such as Sentry and send the errors to them so you can then use a integration webhook to slack or just use their nice dashboard.

Simon

#3

Hi Simon,

Thanks for that recommendation. I was more referring to the actual implementation itself be it sentry or something else. Where and how do you attach the listeners to parse server as it seems like express middlewares cant catch the errors?

#4

Hi Mike,

I know exactly what you mean, attaching a general uncaught error doesn’t seem to work. I have had to implement a high order function to attached to each error handler and make the sentry call…

I think that node will just crash if there is an unhandled error, therefore error listeners don’t catch them. If there is an error, but it’s handled correctly it won’t show in the middleware anyway, therefore the above is the only way to catch them in my knowledge.

#5

Ah thats a real shame. Definitely starting to bump into problems with Parse these days :frowning:

1 Like