Here you can find the source of toRuntimeException(Exception e)
Parameter | Description |
---|---|
e | a parameter |
public static RuntimeException toRuntimeException(Exception e)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . j a v a2s . co m * Do never catch Throwables! * * @param e * @return */ public static RuntimeException toRuntimeException(Exception e) { return e instanceof RuntimeException ? (RuntimeException) e : new RuntimeException(e); } }