Closed toby-griffiths closed 1 year ago
There is a WhatFailureGroupHandler that can be used to wrap other handlers and catch their error.
Right, the idea is that either you suppress errors with WhatFailureGroupHandler or by default we let errors fail so that you notice the problem, otherwise misconfigured logging would simply fail to log silently and that gives a false sense that everything is fine.
Monolog version 3
We have the SlackWebhookHandler implemented in a Symfony project, but have realised that it does not catch exceptions thrown if the cURL request to Slack fails.
We would like to protect our application from completely falling over in the event of comms with Slack failing.
What do people think about adding some error handling around the cURL request in the
SlackWebhookHandler
. I appreciate that we could decorate the handler to add this ourselves, but this is one of the few things that doesn't seem to be well documented in the Symfony docs, as to how to implement, and I've spend over an hour trying to work it out.Keen to know whether this is something people thing we should implement here, or in Symfony?
I've also raised https://github.com/symfony/monolog-bundle/issues/465 to gether thoughts on handling this in Symfony.