error handling
This commit is contained in:
parent
9f085ca304
commit
1840592c1b
2 changed files with 3 additions and 3 deletions
|
@ -61,7 +61,7 @@ final class DeleteAction
|
||||||
$curl->delete(getenv('xmpp_curl_uri') . '/user/' . $username);
|
$curl->delete(getenv('xmpp_curl_uri') . '/user/' . $username);
|
||||||
$curl->close();
|
$curl->close();
|
||||||
|
|
||||||
if ($curl->http_status_code == 200) {
|
if ($curl->http_status_code == 200 || $curl->http_status_code == 404) {
|
||||||
$userRegistered->delete();
|
$userRegistered->delete();
|
||||||
|
|
||||||
$this->flash->addMessage('success', $this->translator->trans('delete.flash.success', ['%username%' => $username, '%server%' => getenv('site_xmpp_server_displayname')]));
|
$this->flash->addMessage('success', $this->translator->trans('delete.flash.success', ['%username%' => $username, '%server%' => getenv('site_xmpp_server_displayname')]));
|
||||||
|
@ -69,7 +69,7 @@ final class DeleteAction
|
||||||
return $response->withRedirect('/');
|
return $response->withRedirect('/');
|
||||||
} else {
|
} else {
|
||||||
$this->flash->addMessage('error', $this->translator->trans('delete.flash.unknown_error', ['%username%' => $username]));
|
$this->flash->addMessage('error', $this->translator->trans('delete.flash.unknown_error', ['%username%' => $username]));
|
||||||
$this->logger->warning($this->translator->trans('log.delete.flash.unknown_error'), ['code' => $curl->http_status_code, 'message' => $curl->http_error_message]);
|
$this->logger->error($this->translator->trans('log.delete.flash.unknown_error'), ['username' => $username, 'code' => $curl->http_status_code, 'message' => $curl->http_error_message]);
|
||||||
return $response->withRedirect('/delete');
|
return $response->withRedirect('/delete');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ final class VerificationAction
|
||||||
return $response->withRedirect('/');
|
return $response->withRedirect('/');
|
||||||
} else {
|
} else {
|
||||||
$this->flash->addMessage('error', $this->translator->trans('verification.flash.unknown_error', ['%username%' => $userAwaiting->username]));
|
$this->flash->addMessage('error', $this->translator->trans('verification.flash.unknown_error', ['%username%' => $userAwaiting->username]));
|
||||||
$this->logger->warning($this->translator->trans('verification.flash.unknown_error'), ['code' => $curl->http_status_code, 'message' => $curl->http_error_message]);
|
$this->logger->warning($this->translator->trans('verification.flash.unknown_error'), ['username' => $userAwaiting->username, 'code' => $curl->http_status_code, 'message' => $curl->http_error_message]);
|
||||||
return $response->withRedirect('/');
|
return $response->withRedirect('/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue