Invalid API endpoint exception improvement
MAILPOET-6022
This commit is contained in:
committed by
Aschepikov
parent
a7df6b496f
commit
95e595de42
@@ -269,10 +269,17 @@ class API {
|
||||
}
|
||||
|
||||
public function createErrorResponse($errorType, $errorMessage, $responseStatus) {
|
||||
$errorMessages = [
|
||||
$errorType => $errorMessage,
|
||||
];
|
||||
|
||||
if ($errorType === Error::BAD_REQUEST) {
|
||||
$mpReinstallErrorMessage = __('The plugin has encountered an unexpected error. Please reload the page. If that does not help, re-install the MailPoet Plugin. See: https://kb.mailpoet.com/article/258-re-installing-updating-the-plugin-via-ftp', 'mailpoet');
|
||||
$errorMessages[Error::REINSTALL_PLUGIN] = $mpReinstallErrorMessage; // not all places on the frontend accept html for an error message. we want this to be backwards compatible
|
||||
}
|
||||
|
||||
$errorResponse = new ErrorResponse(
|
||||
[
|
||||
$errorType => $errorMessage,
|
||||
],
|
||||
$errorMessages,
|
||||
[],
|
||||
$responseStatus
|
||||
);
|
||||
|
Reference in New Issue
Block a user