public static AlluxioStatusException fromCheckedException ( Throwable throwable ) { try { throw throwable ; } catch ( IOException e ) { return fromIOException ( e ) ; } catch ( AlluxioException e ) { return fromAlluxioException ( e ) ; } catch ( InterruptedException e ) { return new CancelledException ( e ) ; } catch ( RuntimeException e ) { throw new IllegalStateException ( "Expected a checked exception but got " + e ) ; } catch ( Exception e ) { return new UnknownException ( e ) ; } catch ( Throwable t ) { throw new IllegalStateException ( "Expected a checked exception but got " + t ) ; } }
Converts checked throwables to Alluxio status exceptions . Unchecked throwables should not be passed to this method . Use Throwables . propagateIfPossible before passing a Throwable to this method .