<?php

namespace WPQT;

if (!defined('ABSPATH')) {
    exit;
}

use Exception;

if (!class_exists('WPQT\WPQTException')) {
    class WPQTException extends Exception
    {
        private $sendToFrontEnd;

        public function __construct($message, $sendToFrontEnd = false, $code = 0, Exception $previous = null)
        {
            $this->sendToFrontEnd = $sendToFrontEnd;
            parent::__construct($message, $code, $previous);
        }

        public function shouldSendToFrontEnd()
        {
            return $this->sendToFrontEnd;
        }
    }
}

if (!class_exists('WPQT\StageHasTasksException')) {
    class StageHasTasksException extends Exception
    {
    }
}

if (!class_exists('WPQT\PipelineMissingException')) {
    class PipelineMissingException extends Exception
    {
    }
}

if (!class_exists('WPQT\StageMissingException')) {
    class StageMissingException extends Exception
    {
    }
}

if (!class_exists('WPQT\TaskMissingException')) {
    class TaskMissingException extends Exception
    {
    }
}
