@Override
public Map<String, String> getResponse(byte[] bytes, int status) {
if (status == Http.Status.OK.statusCode) {
return parse(bytes, getClass());
} else if (status == Http.Status.NOT_FOUND.statusCode) {
throw new RequestFailedException("Application not found.", status, bytes);
} else if (status == Http.Status.FORBIDDEN.statusCode) {
throw new RequestFailedException(
"Insufficient privileges to \"" + config.get(Heroku.RequestKey.AppName) + "\"",
status,
bytes
);
} else {
throw new RequestFailedException("Unable to list config failed.", status, bytes);
}
}