@Test public void handleIllegalStateExceptionThrowableShouldReturnIt(){ Throwable e = new IllegalStateException(); assertSame(e, CRestException.handle(e)); }
public static RuntimeException handle(Throwable e) { if (e instanceof CRestException) { return handle((CRestException) e); }else if (e instanceof RequestException) { return handle((RequestException) e); } else if (e instanceof IllegalArgumentException) { return handle((IllegalArgumentException) e); } else if (e instanceof IllegalStateException) { return handle((IllegalStateException) e); } else if (e instanceof InvocationTargetException) { return handle((InvocationTargetException) e); } else { return new CRestException(e.getMessage(), e); } }
CRestException extends RuntimeException { public static RuntimeException handle(Throwable e) { if (e instanceof CRestException) { return handle((CRestException) e); }else if (e instanceof RequestException) { return handle((RequestException) e); } else if (e instanceof IllegalArgumentException) { return handle((IllegalArgumentException) e); } else if (e instanceof IllegalStateException) { return handle((IllegalStateException) e); } else if (e instanceof InvocationTargetException) { return handle((InvocationTargetException) e); } else { return new CRestException(e.getMessage(), e); } } }
CRestException extends RuntimeException { public static RuntimeException handle(Throwable e) { if (e instanceof CRestException) { return handle((CRestException) e); }else if (e instanceof RequestException) { return handle((RequestException) e); } else if (e instanceof IllegalArgumentException) { return handle((IllegalArgumentException) e); } else if (e instanceof IllegalStateException) { return handle((IllegalStateException) e); } else if (e instanceof InvocationTargetException) { return handle((InvocationTargetException) e); } else { return new CRestException(e.getMessage(), e); } } CRestException();  CRestException(String message);  CRestException(String message, Throwable cause); }
CRestException extends RuntimeException { public static RuntimeException handle(Throwable e) { if (e instanceof CRestException) { return handle((CRestException) e); }else if (e instanceof RequestException) { return handle((RequestException) e); } else if (e instanceof IllegalArgumentException) { return handle((IllegalArgumentException) e); } else if (e instanceof IllegalStateException) { return handle((IllegalStateException) e); } else if (e instanceof InvocationTargetException) { return handle((InvocationTargetException) e); } else { return new CRestException(e.getMessage(), e); } } CRestException();  CRestException(String message);  CRestException(String message, Throwable cause); static RuntimeException handle(Throwable e); static RuntimeException handle(CRestException e); static RuntimeException handle(RequestException e); static RuntimeException handle(IllegalArgumentException e); static RuntimeException handle(IllegalStateException e); static RuntimeException handle(InvocationTargetException e); }
CRestException extends RuntimeException { public static RuntimeException handle(Throwable e) { if (e instanceof CRestException) { return handle((CRestException) e); }else if (e instanceof RequestException) { return handle((RequestException) e); } else if (e instanceof IllegalArgumentException) { return handle((IllegalArgumentException) e); } else if (e instanceof IllegalStateException) { return handle((IllegalStateException) e); } else if (e instanceof InvocationTargetException) { return handle((InvocationTargetException) e); } else { return new CRestException(e.getMessage(), e); } } CRestException();  CRestException(String message);  CRestException(String message, Throwable cause); static RuntimeException handle(Throwable e); static RuntimeException handle(CRestException e); static RuntimeException handle(RequestException e); static RuntimeException handle(IllegalArgumentException e); static RuntimeException handle(IllegalStateException e); static RuntimeException handle(InvocationTargetException e);  }