ConfirmationEmailTemplate
1 month ago
ImportExport
2 weeks ago
RestApi
3 days ago
Statistics
1 month ago
BulkActionController.php
3 days ago
BulkActionException.php
1 month ago
BulkConfirmationEmailResender.php
2 months ago
ConfirmationEmailCustomizer.php
2 months ago
ConfirmationEmailMailer.php
2 months ago
ConfirmationEmailResolver.php
2 months ago
EngagementDataBackfiller.php
2 months ago
InactiveSubscribersController.php
4 days ago
LinkTokens.php
2 months ago
NewSubscriberNotificationMailer.php
2 months ago
RequiredCustomFieldValidator.php
2 months ago
SegmentsCountRecalculator.php
2 weeks ago
Source.php
2 months ago
SubscriberActions.php
2 months ago
SubscriberCustomFieldRepository.php
3 years ago
SubscriberIPsRepository.php
2 years ago
SubscriberLimitNotificationEvaluator.php
2 months ago
SubscriberLimitNotificationMailer.php
2 months ago
SubscriberLimitNotificationScheduler.php
2 months ago
SubscriberListingRepository.php
2 weeks ago
SubscriberPersonalDataEraser.php
2 months ago
SubscriberSaveController.php
3 days ago
SubscriberSegmentRepository.php
2 weeks ago
SubscriberSubscribeController.php
2 weeks ago
SubscriberTagRepository.php
4 years ago
SubscribersCountsController.php
2 weeks ago
SubscribersEmailCountsController.php
2 weeks ago
SubscribersRepository.php
3 days ago
TrackingConsentController.php
4 days ago
index.php
3 years ago
BulkActionException.php
42 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\Subscribers; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use RuntimeException; |
| 9 | use Throwable; |
| 10 | |
| 11 | /** |
| 12 | * Domain-level error raised by {@see BulkActionController}. The HTTP transport |
| 13 | * layer (REST endpoint or legacy JSON endpoint) is responsible for translating |
| 14 | * the carried status code + error code into its own response envelope. |
| 15 | */ |
| 16 | class BulkActionException extends RuntimeException { |
| 17 | /** @var string */ |
| 18 | private $errorCode; |
| 19 | |
| 20 | /** @var int */ |
| 21 | private $statusCode; |
| 22 | |
| 23 | public function __construct( |
| 24 | string $message, |
| 25 | string $errorCode, |
| 26 | int $statusCode = 400, |
| 27 | ?Throwable $previous = null |
| 28 | ) { |
| 29 | parent::__construct($message, 0, $previous); |
| 30 | $this->errorCode = $errorCode; |
| 31 | $this->statusCode = $statusCode; |
| 32 | } |
| 33 | |
| 34 | public function getErrorCode(): string { |
| 35 | return $this->errorCode; |
| 36 | } |
| 37 | |
| 38 | public function getStatusCode(): int { |
| 39 | return $this->statusCode; |
| 40 | } |
| 41 | } |
| 42 |