All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.spotinst.sdkjava.exception.ExceptionHelper Maven / Gradle / Ivy

There is a newer version: 1.0.121
Show newest version
package com.spotinst.sdkjava.exception;

import com.spotinst.sdkjava.model.RepoGenericResponse;

import java.util.List;

/**
 * Created by aharontwizer on 8/26/15.
 */
public class ExceptionHelper {

    public static  RepoGenericResponse handleHttpException(SpotinstHttpException exc) {
        RepoGenericResponse retVal;

        if (exc instanceof SpotinstHttpErrorsException) {
            List httpErrors = ((SpotinstHttpErrorsException) exc).getHttpErrors();
            retVal = new RepoGenericResponse<>(httpErrors);
        } else {
            retVal = new RepoGenericResponse<>(false);
        }

        return retVal;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy