Add method to statically send error email

This commit is contained in:
Jérémy Munsch 2022-08-22 17:14:23 +02:00
parent 8a0024bcc4
commit 36403e6245
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
2 changed files with 24 additions and 0 deletions

View file

@ -2,6 +2,8 @@
All notable changes to `ExceptionHandler` will be documented in this file.
# version 0.1.0
- Add a a method to manually send exception by email (plus the same to call statically).
# version 0.0.9
- Multiline exception message in mail.

View file

@ -50,6 +50,28 @@ class ExceptionHandler extends Handler
parent::report($e);
}
/**
* Manually send exception by email
*
* @param \Throwable $e
* @return void
*/
public static function sendExceptionByEmailStatic(\Throwable $e)
{
app(self::class)->sendExceptionByEmail($e);
}
/**
* Manually send exception by email
*
* @param \Throwable $e
* @return void
*/
public function sendExceptionByEmail(\Throwable $e)
{
$this->reportExceptionByEmail()($e);
}
/**
* Report sending mail closure
*