Workaround for API change for invalid symbol.
This commit is contained in:
parent
8484e2fc0c
commit
1cabb74eb8
2 changed files with 12 additions and 4 deletions
|
@ -113,7 +113,12 @@ public final class StockQuote extends ThreadedModule {
|
|||
try {
|
||||
final String error = json.getString("Error Message");
|
||||
if (!error.isEmpty()) {
|
||||
throw new ModuleException(debugMessage, Utils.unescapeXml(error));
|
||||
if (error.startsWith("Invalid API call.")) {
|
||||
throw new ModuleException(debugMessage + ": " + Utils.unescapeXml(error),
|
||||
"Invalid symbol.");
|
||||
} else {
|
||||
throw new ModuleException(debugMessage, Utils.unescapeXml(error));
|
||||
}
|
||||
}
|
||||
} catch (JSONException ignore) {
|
||||
// Do nothing.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue