RestException¶
-
public class
RestExceptionextends RuntimeException¶ Exception thrown for Http Requests in case of any exception.
Constructors¶
RestException¶
-
public
RestException(HubException exception, List<String> errors)¶ Creates a new
RestExceptioninstance. The exception is constructed fromorg.motechproject.hub.exception.HubExceptionand list of errors that are the reason of this exception.Parameters: - exception – the underlying
HubExceptionexception - errors – list of errors that will be treated as the reason for this exception
- exception – the underlying
RestException¶
-
public
RestException(HubException hubException, String reason)¶ Creates a new
RestExceptioninstance. The exception is constructed fromorg.motechproject.hub.exception.HubExceptionand aStringdescribing exception cause.Parameters: - hubException – the underlying
HubExceptionexception - reason – the reason of the error
- hubException – the underlying
Methods¶
getHttpStatus¶
-
public HttpStatus
getHttpStatus()¶ Gets the HTTP status appropriate for the error that caused this exception.
Returns: the HTTP status of the error
getHubException¶
-
public HubException
getHubException()¶ Gets the underlying
HubException.Returns: the underlying HubException