Skip to content

Send an error message from a plugin #20

Description

@umkasanki

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions