ThrowableUtils.java 383 B

12345678910111213141516
  1. package me.ag2s.utils;
  2. import androidx.annotation.NonNull;
  3. import java.io.IOException;
  4. public class ThrowableUtils {
  5. public static @NonNull
  6. IOException rethrowAsIOException(Throwable throwable) throws IOException {
  7. IOException newException = new IOException(throwable.getMessage());
  8. newException.initCause(throwable);
  9. throw newException;
  10. }
  11. }