124125126127128129130131
private static void throwError(Map<Integer, String> errors, int code) { String msg = errors.get(code); if (msg != null) { throw new DropboxHttpCodeException("Dropbox returns " + code + ": " + msg, code); } }
136137138139140141142143144145
throwError(DROPBOX_ERRORS, code); throwError(OAUTH_ERRORS, code); throwError(API_ERRORS, code); if (code != 200) { throw new DropboxHttpCodeException("Dropbox returns " + code, code); } return response; }