case ErrorCodes.INVALID_VECTOR_FORMAT:
return new InvalidVectorFormatException(error.getMessage(), new Date());
case ErrorCodes.TOO_MANY_IDS:
return new TooManyIdsException(error.getMessage(), new Date());
case ErrorCodes.UNCONSTRAINED_SEARCH:
return new UnconstrainedSearchException(error.getMessage(), new Date());
default:
return new StackExchangeApiException(error.getMessage(), error.getStatusCode(), error.getErrorCode(), new Date());