diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2013-05-03 12:09:57 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2013-05-03 12:09:57 +0200 |
commit | b15cc7d6f4c77fb941c74670eb58fb07bd9c7d9c (patch) | |
tree | 8ff58cb843fd4c00a8e58603a80122e25f018930 /program/steps/utils/spell.inc | |
parent | 517dae3e74e39aceabaf2c5da330849a21e82d81 (diff) |
Check Google spell check service response for errors and report them accordingly
Diffstat (limited to 'program/steps/utils/spell.inc')
-rw-r--r-- | program/steps/utils/spell.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/program/steps/utils/spell.inc b/program/steps/utils/spell.inc index a0dd35d27..b59fe7998 100644 --- a/program/steps/utils/spell.inc +++ b/program/steps/utils/spell.inc @@ -42,6 +42,13 @@ else { $result = $spellchecker->get_xml(); } +if ($err = $spellchecker->error()) { + raise_error(array('code' => 500, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => sprintf("Spell check engine error: " . $err)), + true, false); +} + // set response length header("Content-Length: " . strlen($result)); |