From b15cc7d6f4c77fb941c74670eb58fb07bd9c7d9c Mon Sep 17 00:00:00 2001 From: Thomas Bruederli <thomas@roundcube.net> Date: Fri, 03 May 2013 06:09:57 -0400 Subject: [PATCH] Check Google spell check service response for errors and report them accordingly --- 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 a0dd35d..b59fe79 100644 --- a/program/steps/utils/spell.inc +++ b/program/steps/utils/spell.inc @@ -42,6 +42,13 @@ $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)); -- Gitblit v1.9.1