Commit 9594acdc authored by Jorgen's avatar Jorgen

Improve typo correction status errors

parent bdb6144b
......@@ -347,7 +347,15 @@ class Typo extends CI_Model {
->withUsername($user)
->withPassword($password);
$client->fixTypo($correction->text, $corrected, $correction->context, $correction->link);
$result = $client->fixTypo($correction->text, $corrected, $correction->context, $correction->link);
if (!isset($result["status"])) {
throw new Exception("Неправильный ответ сервера");
}
if ($result["status"] != "success") {
throw new Exception("Не удалось исправить опечатку: ". $result["message"]);
}
} catch(ConnectionFailureException $e) {
throw new Exception("Не удалось подключиться к серверу исправления опечаток", 503);
} catch(AccessDeniedException $e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment