HubException

public class HubException extends Exception

This class is used for custom exception for the Hub Module

Author:anuranjan

Constructors

HubException

public HubException(HubErrors hubErrors)

Creates a new HubException instance from org.motechproject.hub.exception.HubErrors passed as a parameter.

Parameters:
  • hubErrors – the error that caused the exception

HubException

public HubException(HubErrors hubErrors, String reason)

Creates a new HubException instance from org.motechproject.hub.exception.HubErrors and a String describing error cause passed as a parameters.

Parameters:
  • hubErrors – the error that caused the exception
  • reason – reason for the error

HubException

public HubException(HubErrors hubErrors, Throwable throwable)

Creates a new HubException instance from org.motechproject.hub.exception.HubErrors and Throwable that caused this exception passed as a parameters.

Parameters:
  • hubErrors – the error that caused the exception
  • throwable – the underlying exception

HubException

public HubException(HubErrors hubErrors, Throwable throwable, String reason)

Creates a new HubException instance from org.motechproject.hub.exception.HubErrors, Throwable that caused this exception and a String describing error cause passed as a parameters.

Parameters:
  • hubErrors – the error that caused the exception
  • throwable – the underlying exception
  • reason – the reason for this error

Methods

getError

public HubErrors getError()

Gets the underlying org.motechproject.hub.exception.HubErrors error.

Returns:the underlying org.motechproject.hub.exception.HubErrors error

getErrorCode

public int getErrorCode()

Gets the error code for the underlying error.

Returns:the error code

getErrorMessage

public String getErrorMessage()

Gets a short description of the error.

Returns:the message representing this error

getErrorMessageDetails

public String getErrorMessageDetails()

Gets the stacktrace of this exception as a String.

Returns:the stacktrace for this exception as a String

getReason

public String getReason()

Gets a String describing the cause of this error.

Returns:the reason of this error

setReason

public void setReason(String reason)

Sets a String describing the cause of this error.

Parameters:
  • reason – the reason of this error