Skip to content

Commit

Permalink
fix: handle internal error when handling command
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumelamirand committed Apr 12, 2024
1 parent 5a336e3 commit 2198d43
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -19,6 +19,7 @@

import io.gravitee.exchange.api.channel.Channel;
import io.gravitee.exchange.api.channel.exception.ChannelClosedException;
import io.gravitee.exchange.api.channel.exception.ChannelException;
import io.gravitee.exchange.api.channel.exception.ChannelInactiveException;
import io.gravitee.exchange.api.channel.exception.ChannelInitializationException;
import io.gravitee.exchange.api.channel.exception.ChannelNoReplyException;
Expand Down Expand Up @@ -202,6 +203,10 @@ private <C extends Command<?>> void receiveCommand(final CompletableEmitter emit
}
return Completable.complete();
})
.onErrorResumeNext(throwable -> {
log.warn("Unexpected internal error occurred when handling command type %s".formatted(command.getId()));
return writeReply(new NoReply(command.getId(), "Unexpected internal error occurred"));
})
.subscribe();
}

Expand Down

0 comments on commit 2198d43

Please sign in to comment.