} catch (ParseException e) {
errorCode = -1;
}
type = type != null ? type : SPID_EXCEPTION;
if (type.equals(API_EXCEPTION)) {
<BUG>return new SPiDApiException(error, descriptions, errorCode, type);
} else if (type.equals(OAUTH_EXCEPTION)) {</BUG>
return new SPiDOAuthException(error, descriptions, errorCode, type);
} else {
return new SPiDException(error, descriptions, errorCode, SPID_EXCEPTION);

} catch (ParseException e) {
errorCode = -1;
}
type = type != null ? type : SPID_EXCEPTION;
if (type.equals(API_EXCEPTION)) {
return new SPiDApiException(error, descriptions, errorCode, type);
} else if (error != null && (error.equals(INVALID_TOKEN) || error.equals(EXPIRED_TOKEN))) {
return new SPiDInvalidAccessTokenException(error, descriptions, errorCode, type);
} else if (type.equals(OAUTH_EXCEPTION)) {
return new SPiDOAuthException(error, descriptions, errorCode, type);
} else {
return new SPiDException(error, descriptions, errorCode, SPID_EXCEPTION);
