From 4eaa1674d67812528904af7ef5417c0c69e8924e Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 30 Oct 2023 21:36:29 +0300 Subject: [PATCH] Fix Exception class name and base class. --- example/java/org/drinkless/tdlib/Client.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/example/java/org/drinkless/tdlib/Client.java b/example/java/org/drinkless/tdlib/Client.java index 7ddfd2fe0..dfee746fc 100644 --- a/example/java/org/drinkless/tdlib/Client.java +++ b/example/java/org/drinkless/tdlib/Client.java @@ -65,7 +65,7 @@ public final class Client { /** * Exception class thrown when TDLib error occurred while performing {@link #execute(TdApi.Function)}. */ - public static class ExecutionError extends Throwable { + public static class ExecutionException extends Exception { /** * Original TDLib error occurred when performing one of the synchronous functions. */ @@ -74,7 +74,7 @@ public final class Client { /** * @param error TDLib error occurred while performing {@link #execute(TdApi.Function)}. */ - ExecutionError (TdApi.Error error) { + ExecutionException (TdApi.Error error) { super(error.code + ": " + error.message); this.error = error; } @@ -120,12 +120,12 @@ public final class Client { * @param Automatically deduced return type of the query. * @return request result. * @throws NullPointerException if query is null. - * @throws ExecutionError if query execution fails. + * @throws ExecutionException if query execution fails. */ - public static T execute(TdApi.Function query) throws ExecutionError { + public static T execute(TdApi.Function query) throws ExecutionException { TdApi.Object object = nativeClientExecute(query); if (object instanceof TdApi.Error) { - throw new ExecutionError((TdApi.Error) object); + throw new ExecutionException((TdApi.Error) object); } if (object == null) { // unreachable