Errors and Exceptions - lico/jFixer GitHub Wiki

The Fixer.io returns a list of error codes in case of invalid input data or other situations.

jFixer wraps these errors into a FixerException object.

Example

try {    
    FixerApiLoader fixerApiLoader = (baseUrl, accessKey, baseCurrency);    
    List<ExchangeRate> rates = fixerApiLoader.getLatest();    
} catch (FixerException e) {    
    log.error(e.getCode()); // returns the code sent by Fixer.io, eg: 105    
    log.error(e.getType()); // returns the type sent by Fixer.io, eg: base_currency_access_restricted    
    log.error(e.getInfo()); // return the info sent by Fixer.io, eg: The current subscription plan does not support this API endpoint.    
}