Change the JSON API error message

[MAILPOET-1103]
This commit is contained in:
amine-mp
2017-10-10 10:45:50 +02:00
committed by pavel-mailpoet
parent 3d9dc6465d
commit b6c864e7a1

View File

@ -57,7 +57,7 @@ class API {
$this->setRequestData($_POST);
if($this->checkToken() === false) {
$error_message = __('Invalid API request.', 'mailpoet');
$error_message = __('Sorry, but we couldn\'t connect to the MailPoet server. Please refresh the web page and try again.', 'mailpoet');
$error_response = $this->createErrorResponse(Error::UNAUTHORIZED, $error_message, Response::STATUS_UNAUTHORIZED);
return $error_response->send();
}
@ -200,4 +200,4 @@ class API {
);
return $error_response;
}
}
}