Use constants for exception codes

[MAILPOET-2107]
This commit is contained in:
Pavel Dohnal
2019-06-06 09:05:27 +02:00
committed by M. Shull
parent 8ee1ead0a6
commit f17e7251c3
3 changed files with 62 additions and 36 deletions

View File

@ -4,4 +4,19 @@ namespace MailPoet\API\MP\v1;
if (!defined('ABSPATH')) exit;
class APIException extends \Exception {
const FAILED_TO_SAVE_SUBSCRIBER_FIELD = 1;
const SEGMENT_REQUIRED = 3;
const SUBSCRIBER_NOT_EXISTS = 4;
const LIST_NOT_EXISTS = 5;
const SUBSCRIBING_TO_WP_LIST_NOT_ALLOWED = 6;
const SUBSCRIBING_TO_WC_LIST_NOT_ALLOWED = 7;
const SUBSCRIBING_TO_LIST_NOT_ALLOWED = 8;
const CONFIRMATION_FAILED_TO_SEND = 10;
const EMAIL_ADDRESS_REQUIRED = 11;
const SUBSCRIBER_EXISTS = 12;
const FAILED_TO_SAVE_SUBSCRIBER = 13;
const LIST_NAME_REQUIRED = 14;
const LIST_EXISTS = 15;
const FAILED_TO_SAVE_LIST = 16;
const WELCOME_FAILED_TO_SEND = 17;
}