All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.rollbar.notifier.sender.exception.ApiException Maven / Gradle / Ivy

Go to download

For connecting your applications built on the JVM to Rollbar for Error Reporting

There is a newer version: 2.0.0-alpha.1
Show newest version
package com.rollbar.notifier.sender.exception;

import com.rollbar.notifier.sender.result.Response;
import com.rollbar.notifier.util.ObjectsUtils;

/**
 * Represents an error return by the Rollbar API.
 */
public class ApiException extends RuntimeException {

  private final Response response;

  /**
   * Constructor.
   * @param response the response.
   */
  public ApiException(Response response) {
    super(response.getResult().getContent());
    this.response = response;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiException that = (ApiException) o;
    return ObjectsUtils.equals(response, that.response);
  }

  @Override
  public int hashCode() {
    return ObjectsUtils.hash(response);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy