Updated examples with error ID

This commit is contained in:
Erik C. Thauvin 2023-01-29 01:38:54 -08:00
parent 1906a24343
commit eefd4ee615
3 changed files with 3 additions and 3 deletions

View file

@ -20,7 +20,7 @@ repositories {
} }
dependencies { dependencies {
implementation("net.thauvin.erik:cryptoprice:1.1.0-SNAPSHOT") implementation("net.thauvin.erik:cryptoprice:1.0.1-SNAPSHOT")
implementation("org.json:json:20220924") implementation("org.json:json:20220924")
} }

View file

@ -48,7 +48,7 @@ public class CryptoPriceSample {
} }
} catch (CryptoException e) { } catch (CryptoException e) {
System.err.println("HTTP Status Code: " + e.getStatusCode()); System.err.println("HTTP Status Code: " + e.getStatusCode());
System.err.println(e.getMessage()); System.err.println(e.getMessage() + " (" + e.getId() + ')');
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
System.err.println("Could not display the specified currency: " + args[1]); System.err.println("Could not display the specified currency: " + args[1]);
} catch (IOException e) { } catch (IOException e) {

View file

@ -40,7 +40,7 @@ fun main(args: Array<String>) {
} }
} catch (e: CryptoException) { } catch (e: CryptoException) {
System.err.println("HTTP Status Code: ${e.statusCode}") System.err.println("HTTP Status Code: ${e.statusCode}")
System.err.println(e.message) System.err.println("${e.message} (${e.id})")
} catch (e: IllegalArgumentException) { } catch (e: IllegalArgumentException) {
System.err.println("Could not display the specified currency: ${args[1]}") System.err.println("Could not display the specified currency: ${args[1]}")
} catch (e: IOException) { } catch (e: IOException) {