public static final class DataSourceStatusProvider.ErrorInfo
extends java.lang.Object
Constructor and Description |
---|
ErrorInfo(DataSourceStatusProvider.ErrorKind kind,
int statusCode,
java.lang.String message,
java.time.Instant time)
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
static DataSourceStatusProvider.ErrorInfo |
fromException(DataSourceStatusProvider.ErrorKind kind,
java.lang.Throwable t)
Constructs an instance based on an exception.
|
static DataSourceStatusProvider.ErrorInfo |
fromHttpError(int statusCode)
Constructs an instance based on an HTTP error status.
|
DataSourceStatusProvider.ErrorKind |
getKind()
Returns an enumerated value representing the general category of the error.
|
java.lang.String |
getMessage()
Returns any additional human-readable information relevant to the error.
|
int |
getStatusCode()
Returns the HTTP status code if the error was
DataSourceStatusProvider.ErrorKind.ERROR_RESPONSE , or zero otherwise. |
java.time.Instant |
getTime()
Returns the date/time that the error occurred.
|
int |
hashCode() |
java.lang.String |
toString() |
public ErrorInfo(DataSourceStatusProvider.ErrorKind kind, int statusCode, java.lang.String message, java.time.Instant time)
kind
- the general category of the errorstatusCode
- an HTTP status or zeromessage
- an error message if applicable, or nulltime
- the error timestamppublic static DataSourceStatusProvider.ErrorInfo fromException(DataSourceStatusProvider.ErrorKind kind, java.lang.Throwable t)
kind
- the general category of the errort
- the exceptionpublic static DataSourceStatusProvider.ErrorInfo fromHttpError(int statusCode)
statusCode
- the status codepublic DataSourceStatusProvider.ErrorKind getKind()
public int getStatusCode()
DataSourceStatusProvider.ErrorKind.ERROR_RESPONSE
, or zero otherwise.public java.lang.String getMessage()
public java.time.Instant getTime()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object