From eefd4ee6154f0601e8a14b8bbc5089d027f0a741 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 29 Jan 2023 01:38:54 -0800 Subject: [PATCH] Updated examples with error ID --- examples/build.gradle.kts | 2 +- examples/src/main/java/com/example/CryptoPriceSample.java | 2 +- examples/src/main/kotlin/com/example/CryptoPriceExample.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index d61bc18..8710dc8 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -20,7 +20,7 @@ repositories { } dependencies { - implementation("net.thauvin.erik:cryptoprice:1.1.0-SNAPSHOT") + implementation("net.thauvin.erik:cryptoprice:1.0.1-SNAPSHOT") implementation("org.json:json:20220924") } diff --git a/examples/src/main/java/com/example/CryptoPriceSample.java b/examples/src/main/java/com/example/CryptoPriceSample.java index 6a32bff..e9e33e5 100644 --- a/examples/src/main/java/com/example/CryptoPriceSample.java +++ b/examples/src/main/java/com/example/CryptoPriceSample.java @@ -48,7 +48,7 @@ public class CryptoPriceSample { } } catch (CryptoException e) { System.err.println("HTTP Status Code: " + e.getStatusCode()); - System.err.println(e.getMessage()); + System.err.println(e.getMessage() + " (" + e.getId() + ')'); } catch (IllegalArgumentException e) { System.err.println("Could not display the specified currency: " + args[1]); } catch (IOException e) { diff --git a/examples/src/main/kotlin/com/example/CryptoPriceExample.kt b/examples/src/main/kotlin/com/example/CryptoPriceExample.kt index 413960a..4eb0a6c 100644 --- a/examples/src/main/kotlin/com/example/CryptoPriceExample.kt +++ b/examples/src/main/kotlin/com/example/CryptoPriceExample.kt @@ -40,7 +40,7 @@ fun main(args: Array) { } } catch (e: CryptoException) { System.err.println("HTTP Status Code: ${e.statusCode}") - System.err.println(e.message) + System.err.println("${e.message} (${e.id})") } catch (e: IllegalArgumentException) { System.err.println("Could not display the specified currency: ${args[1]}") } catch (e: IOException) {