Added exception status code and message to examples.

This commit is contained in:
Erik C. Thauvin 2021-06-11 16:53:55 -07:00
parent 8f08fd738b
commit a704b955dc
5 changed files with 63 additions and 23 deletions

View file

@ -38,7 +38,10 @@ public class CryptoPriceSample {
System.out.println("The current " + buyPrice.getBase() + " buy price is " + buyPrice.getAmount()
+ " in " + buyPrice.getCurrency());
} catch (CryptoException | IOException e) {
} catch (CryptoException e) {
System.err.println("HTTP Status Code: " + e.getStatusCode());
System.err.println(e.getMessage());
} catch (IOException e) {
System.err.println(e.getMessage());
}
}