@Override protected T run() { try { return runMongoCommand(); } catch (MongoSocketException mse) { // must rethrow because MongoSocketException is instance of RuntimeException throw mse; } catch (RuntimeException x) { throw new HystrixBadRequestException("in " + getClass().getName(), x); } }
public T executeAndUnwrap() { try { return execute(); } catch (HystrixRuntimeException x) { Throwable t=x.getCause(); if(t instanceof RuntimeException) throw (RuntimeException)t; else throw new RuntimeException(t); } } }
@Override protected T run() { try { return runMongoCommand(); } catch (MongoSocketException mse) { // must rethrow because MongoSocketException is instance of RuntimeException throw mse; } catch(MongoException me) { throw me; } catch (RuntimeException x) { StringWriter sw=new StringWriter(); PrintWriter w=new PrintWriter(sw); w.println(x.toString()); x.printStackTrace(w); throw new HystrixBadRequestException("in " + getClass().getName()+":"+sw.toString(),x); } }