Class ErrorResult
java.lang.Object
io.fluxzero.common.api.ErrorResult
- All Implemented Interfaces:
JsonType, RequestResult
A generic error response returned when a request could not be completed successfully.
Contains a textual error message explaining the failure. This class is often returned in place of the expected
RequestResult if an error occurs in the Fluxzero Runtime or client.
Exception Behavior
If anErrorResult is received for a Request, the associated CompletableFuture will be
completed exceptionally with a ServiceException that wraps the error message. This allows applications to
handle errors via standard future.exceptionally(...) mechanisms.
keyValueClient.send(new GetValue("missingKey"))
.exceptionally(error -> {
if (error instanceof ServiceException) {
log.warn("Failed: " + error.getMessage());
}
return null;
});
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RequestResult
getRequestId, getTimestamp
-
Constructor Details
-
ErrorResult
public ErrorResult()
-