![JAR search and dependency download from the Maven repository](/logo.png)
com.github.oohira.intercom.IntercomException Maven / Gradle / Ivy
package com.github.oohira.intercom;
import com.github.oohira.intercom.model.ErrorResponse;
/**
* This exception is raised if there is a issue during calling Intercom APIs.
*
* @author oohira
*/
public class IntercomException extends RuntimeException {
private ErrorResponse error;
public IntercomException(final String message) {
super(message);
}
public IntercomException(final ErrorResponse error) {
super(error.getType() + ": " + error.getMessage());
this.error = error;
}
public IntercomException(final Throwable cause) {
super(cause);
}
/**
* Get an error response object from Intercom.
*
* @return an error response object. (may be null)
* @see
* Intercom API Documentation: Response Codes & Errors
*/
public ErrorResponse getErrorResponse() {
return this.error;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy