RestException¶
-
public class
RestException
extends RuntimeException¶ Exception thrown for Http Requests in case of any exception.
Constructors¶
RestException¶
-
public
RestException
(HubException exception, List<String> errors)¶ Creates a new
RestException
instance. The exception is constructed fromorg.motechproject.hub.exception.HubException
and list of errors that are the reason of this exception.Parameters: - exception – the underlying
HubException
exception - 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
RestException
instance. The exception is constructed fromorg.motechproject.hub.exception.HubException
and aString
describing exception cause.Parameters: - hubException – the underlying
HubException
exception - 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