Map<String, Object> errorMap = (Map<String, Object>) maybeAMap;
Integer code = TestLinkHelper.getInteger(errorMap, "code");
String message = TestLinkHelper.getString(errorMap, "message");
if (code != null) {
throw new TestLinkAPIException(code, message);
}
} // endif
} // endfor
} else if (response instanceof Map<?, ?>) {
final Map<String, Object> errorMap = (Map<String, Object>) response;
final Integer statusOk = TestLinkHelper.getInteger(errorMap, "status_ok");
final String message = TestLinkHelper.getString(errorMap, "msg");
if (statusOk != null && statusOk.equals(FALSE_IN_PHP)) {
throw new TestLinkAPIException(statusOk, message);
}
}
}