Bugfix
This commit is contained in:
parent
4df3cb1b84
commit
b59e23b03e
@ -44,6 +44,7 @@ public class ResponseError extends IOException {
|
||||
this.code = 500;
|
||||
this.message = cause.getMessage();
|
||||
this.cause = cause;
|
||||
this.initCause(cause);
|
||||
}
|
||||
|
||||
public ResponseError(@NotNull String tag, @NotNull String botName, @NotNull Throwable cause) {
|
||||
@ -53,6 +54,7 @@ public class ResponseError extends IOException {
|
||||
this.code = 500;
|
||||
this.message = cause.getMessage();
|
||||
this.cause = cause;
|
||||
this.initCause(cause);
|
||||
}
|
||||
|
||||
public static ResponseError newResponseError(@NotNull Function function, @NotNull String botName, @NotNull TdApi.Error cause) {
|
||||
|
@ -2,7 +2,6 @@ package it.tdlight.tdlibsession.td;
|
||||
|
||||
import it.tdlight.common.ReactiveTelegramClient;
|
||||
import it.tdlight.jni.TdApi;
|
||||
import it.tdlight.jni.TdApi.Error;
|
||||
import it.tdlight.utils.MonoUtils;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
@ -47,14 +46,7 @@ public class WrappedReactorTelegramClient implements ReactorTelegramClient {
|
||||
*/
|
||||
@Override
|
||||
public Mono<TdApi.Object> send(TdApi.Function query) {
|
||||
return Flux.from(reactiveTelegramClient.send(query)).single().handle((item, sink) -> {
|
||||
if (item.getConstructor() == Error.CONSTRUCTOR) {
|
||||
var error = ((TdApi.Error) item);
|
||||
sink.error(new TdError(error.code, error.message));
|
||||
} else {
|
||||
sink.next(item);
|
||||
}
|
||||
});
|
||||
return Mono.from(reactiveTelegramClient.send(query)).single();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user