toError

public static Optional<Error> toError(Metadata metadata)

Returns the Error extracted from the Metadata.

Return

the error extracted from the metadata or Optional.empty() if there is no error.

Parameters

metadata

the metadata to convert