Class ErrorResponse
java.lang.Object
net.thauvin.erik.frankfurter.models.ErrorResponse
- All Implemented Interfaces:
CurrenciesResult,CurrencyResult,ProvidersResult,RateResult,RatesResult
public final class ErrorResponse
extends Object
implements CurrenciesResult, CurrencyResult, ProvidersResult, RatesResult, RateResult
Represents an error response returned by the Frankfurter API.
This type models the structure of error payloads returned by any endpoint. It is used when the API responds with a non‑200 HTTP status code. Instances may originate from parsed JSON or from fallback text when parsing fails.
ErrorResponse participates in all result hierarchies
(CurrenciesResult, CurrencyResult, ProvidersResult,
RatesResult, RateResult) so callers can uniformly handle
success and error outcomes.
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Constructor Summary
ConstructorsConstructorDescriptionErrorResponse(int status, @Nullable String message) Creates a new error response. -
Method Summary
-
Constructor Details
-
ErrorResponse
Creates a new error response.- Parameters:
status- the HTTP status code returned by the APImessage- the error message, ornullif none was provided
-
-
Method Details
-
message
Returns the error message provided by the API.- Returns:
- the error message, or
nullif none was provided
-
status
public int status()Returns the HTTP status code associated with this error.- Returns:
- the HTTP status code
-