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

com.qcloud.cos.exception.Throwables Maven / Gradle / Ivy

The newest version!
package com.qcloud.cos.exception;

public class Throwables {

    /**
     * Used to help perform common throw-up with minimal wrapping.
     */
    public static RuntimeException failure(Throwable t) {
        if (t instanceof RuntimeException)
            return (RuntimeException)t;
        if (t instanceof Error)
            throw (Error)t;
        return t instanceof InterruptedException
             ? new AbortedException(t)
             : new CosClientException(t);
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy