craft-sentry
craft-sentry copied to clipboard
Send an error message from a plugin
How can I send an error message from a plugin to Sentry? e.g.
<?php
namespace supercraft\simplicatesubscriber;
use Craft;
use craft\guestentries\controllers\SaveController;
use craft\guestentries\events\SaveEvent;
use yii\base\Event;
use lukeyouell\sentry\Sentry;
class Plugin extends \craft\base\Plugin
{
public $hasCpSection = false;
public function init()
{
parent::init();
Event::on(SaveController::class, SaveController::EVENT_AFTER_SAVE_ENTRY, static function (SaveEvent $e) {
...
if ($error) {
// send error warning
}
});
}
}
Thanks for great plugin!