public ThrottlingException(String msg) { super(msg); // Dirty workaround to get the information after // ((RemoteException)e.getCause()).unwrapRemoteException() for (int i = 0; i < MSG_TYPE.length; ++i) { int index = msg.indexOf(MSG_TYPE[i]); if (index >= 0) { String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length()); type = Type.values()[i]; waitInterval = timeFromString(waitTimeStr); break; } } }
public ThrottlingException(String msg) { super(msg); // Dirty workaround to get the information after // ((RemoteException)e.getCause()).unwrapRemoteException() for (int i = 0; i < MSG_TYPE.length; ++i) { int index = msg.indexOf(MSG_TYPE[i]); if (index >= 0) { String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length()); type = Type.values()[i]; waitInterval = timeFromString(waitTimeStr); break; } } }
public ThrottlingException(String msg) { super(msg); // Dirty workaround to get the information after // ((RemoteException)e.getCause()).unwrapRemoteException() for (int i = 0; i < MSG_TYPE.length; ++i) { int index = msg.indexOf(MSG_TYPE[i]); if (index >= 0) { String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length()); type = Type.values()[i]; waitInterval = timeFromString(waitTimeStr); break; } } }
private static void throwThrottlingException(final Type type, final long waitInterval) throws ThrottlingException { String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + formatTime(waitInterval); throw new ThrottlingException(type, waitInterval, msg); }
private static void throwThrottlingException(final Type type, final long waitInterval) throws ThrottlingException { String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + formatTime(waitInterval); throw new ThrottlingException(type, waitInterval, msg); }
public ThrottlingException(String msg) { super(msg); // Dirty workaround to get the information after // ((RemoteException)e.getCause()).unwrapRemoteException() for (int i = 0; i < MSG_TYPE.length; ++i) { int index = msg.indexOf(MSG_TYPE[i]); if (index >= 0) { String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length()); type = Type.values()[i]; waitInterval = timeFromString(waitTimeStr); break; } } }
private static void throwThrottlingException(final Type type, final long waitInterval) throws ThrottlingException { String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + formatTime(waitInterval); throw new ThrottlingException(type, waitInterval, msg); }
private static void throwThrottlingException(final Type type, final long waitInterval) throws ThrottlingException { String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + formatTime(waitInterval); throw new ThrottlingException(type, waitInterval, msg); }