<?php

declare(strict_types=1);

namespace Drupal\flowdrop_runtime\Event;

use Symfony\Contracts\EventDispatcher\Event;

/**
 * Event dispatched when an error is recorded by the monitor.
 *
 * @internal
 */
class MonitoringErrorEvent extends Event {

  /**
   * The event name.
   */
  const NAME = 'flowdrop_runtime.monitoring.error';

  /**
   * Constructs a new MonitoringErrorEvent.
   *
   * @param \Exception $error
   *   The error that occurred.
   * @param string $executionId
   *   The execution ID.
   * @param string $errorMessage
   *   The error message.
   * @param array $context
   *   Additional context.
   * @param int $timestamp
   *   The event timestamp.
   */
  public function __construct(
    public readonly \Exception $error,
    public readonly string $executionId,
    public readonly string $errorMessage,
    public readonly array $context,
    public readonly int $timestamp,
  ) {}

}
