public static BaseServerResponseException newInstance(int theStatusCode, String theMessage) { if (ourStatusCodeToExceptionType.containsKey(theStatusCode)) { try { return ourStatusCodeToExceptionType.get(theStatusCode).getConstructor(new Class[] { String.class }).newInstance(theMessage); } catch (InstantiationException e) { throw new InternalErrorException(e); } catch (IllegalAccessException e) { throw new InternalErrorException(e); } catch (IllegalArgumentException e) { throw new InternalErrorException(e); } catch (InvocationTargetException e) { throw new InternalErrorException(e); } catch (NoSuchMethodException e) { throw new InternalErrorException(e); } catch (SecurityException e) { throw new InternalErrorException(e); } } return new UnclassifiedServerFailureException(theStatusCode, theMessage); }
break; default: ex = new UnclassifiedServerFailureException(theStatusCode, "Server responded with HTTP " + theStatusCode); break;
break; default: ex = new UnclassifiedServerFailureException(theStatusCode, "Server responded with HTTP " + theStatusCode); break;
public static BaseServerResponseException newInstance(int theStatusCode, String theMessage) { if (ourStatusCodeToExceptionType.containsKey(theStatusCode)) { try { return ourStatusCodeToExceptionType.get(theStatusCode).getConstructor(new Class[] { String.class }).newInstance(theMessage); } catch (InstantiationException e) { throw new InternalErrorException(e); } catch (IllegalAccessException e) { throw new InternalErrorException(e); } catch (IllegalArgumentException e) { throw new InternalErrorException(e); } catch (InvocationTargetException e) { throw new InternalErrorException(e); } catch (NoSuchMethodException e) { throw new InternalErrorException(e); } catch (SecurityException e) { throw new InternalErrorException(e); } } return new UnclassifiedServerFailureException(theStatusCode, theMessage); }
break; default: ex = new UnclassifiedServerFailureException(theStatusCode, "Server responded with HTTP " + theStatusCode); break;
break; default: ex = new UnclassifiedServerFailureException(theStatusCode, "Server responded with HTTP " + theStatusCode); break;