Last active
June 4, 2024 22:36
-
-
Save jules0x/3212fb3a0d1d694a9d467cd782657914 to your computer and use it in GitHub Desktop.
raygun-error-manual
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Tasks; | |
use Psr\Log\LoggerInterface; | |
use SilverStripe\Core\Injector\Injector; | |
use SilverStripe\Dev\BuildTask; | |
/** | |
* BuildTask to cause Raygun to fire. This can be used to test Slack/Raygun integration. | |
*/ | |
class TestRaygun extends BuildTask | |
{ | |
protected $title = '[Raygun] Test Task'; | |
protected $description = "Used to check if Raygun is properly setup"; | |
private static $segment = 'raygun-test'; | |
public function run($request) | |
{ | |
$testError = new \Error('[Test\] This is a test error message for raygun'); | |
Injector::inst()->get(LoggerInterface::class)->error( | |
$testError->getMessage(), | |
['exception' => $testError] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment