The alchemyAPI can return exceptions.
"lorem ispum" text will throw a new exception "Error making API call: unsupported-text-language" doing Drupal crash, specially bad with auto-tagging :(.
I didn't check all the code but here an example for function alchemy_get_elements
// Extract topic keywords from a text string.
try {
switch ($type) {
case 'entities':
$resultstr = $alchemyObj->TextGetRankedNamedEntities($text);
break;
case 'categories':
$resultstr = $alchemyObj->TextGetCategory($text);
break;
case 'concepts':
$resultstr = $alchemyObj->TextGetRankedConcepts($text);
break;
case 'keywords':
$resultstr = $alchemyObj->TextGetRankedKeywords($text);
break;
}
} catch (Exception $exc) {
dpm($exc->getMessage());
return;
}
Comments
Comment #1
gagarine commentedOups .... of course I should not use dpm but a drupal_set_message
Comment #2
BoogieBug commentedI found the problem indirectly from the linkintel module which come from the same root cause - when entering an empty QuickSEO analyzer keyword it will generate a blank white page with the following error message in the log file.
The code in #2 resolve this problem.
Comment #3
TomDude48 commentedThanks gagarine for the code, I have it added.