FileDocCategorySizeDatePackage
ExceptionUtils.javaAPI DocAndroid 5.1 API1946Thu Mar 12 22:22:10 GMT 2015android.util

ExceptionUtils

public class ExceptionUtils extends Object
Utility methods for proxying richer exceptions across Binder calls.
hide

Fields Summary
private static final String
PREFIX_IO
Constructors Summary
Methods Summary
public static java.lang.StringgetCompleteMessage(java.lang.String msg, java.lang.Throwable t)

        final StringBuilder builder = new StringBuilder();
        if (msg != null) {
            builder.append(msg).append(": ");
        }
        builder.append(t.getMessage());
        while ((t = t.getCause()) != null) {
            builder.append(": ").append(t.getMessage());
        }
        return builder.toString();
    
public static java.lang.StringgetCompleteMessage(java.lang.Throwable t)

        return getCompleteMessage(null, t);
    
public static voidmaybeUnwrapIOException(java.lang.RuntimeException e)

        if ((e instanceof IllegalStateException) && e.getMessage().startsWith(PREFIX_IO)) {
            throw new IOException(e.getMessage().substring(PREFIX_IO.length()));
        }
    
public static java.lang.RuntimeExceptionwrap(java.io.IOException e)


         
        throw new IllegalStateException(PREFIX_IO + e.getMessage());