Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,27 @@ final class AdaptingDriverBoltConnection implements DriverBoltConnection {
public CompletionStage<Void> writeAndFlush(DriverResponseHandler handler, List<Message> messages) {
return connection
.writeAndFlush(new AdaptingDriverResponseHandler(handler, errorMapper, boltValueFactory), messages)
.exceptionally(errorMapper::mapAndTrow);
.exceptionally(errorMapper::mapAndThrow);
}

@Override
public CompletionStage<Void> write(List<Message> messages) {
return connection.write(messages).exceptionally(errorMapper::mapAndTrow);
return connection.write(messages).exceptionally(errorMapper::mapAndThrow);
}

@Override
public CompletionStage<Void> forceClose(String reason) {
return connection.forceClose(reason).exceptionally(errorMapper::mapAndTrow);
return connection.forceClose(reason).exceptionally(errorMapper::mapAndThrow);
}

@Override
public CompletionStage<Void> close() {
return connection.close().exceptionally(errorMapper::mapAndTrow);
return connection.close().exceptionally(errorMapper::mapAndThrow);
}

@Override
public CompletionStage<AuthInfo> authData() {
return connection.authInfo().exceptionally(errorMapper::mapAndTrow);
return connection.authInfo().exceptionally(errorMapper::mapAndThrow);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public CompletionStage<DriverBoltConnection> connect(
notificationConfig,
databaseNameConsumer,
additionalParameters)
.exceptionally(errorMapper::mapAndTrow)
.exceptionally(errorMapper::mapAndThrow)
.thenApply(boltConnection -> new AdaptingDriverBoltConnection(
boltConnection,
routed ? new RoutedErrorMapper(boltConnection.serverAddress(), mode) : errorMapper,
Expand All @@ -114,7 +114,7 @@ public CompletionStage<Void> verifyConnectivity(SecurityPlan securityPlan, Map<S
connectTimeoutMillis,
securityPlan,
AuthTokens.custom(boltValueFactory.toBoltMap(authMap)))
.exceptionally(errorMapper::mapAndTrow);
.exceptionally(errorMapper::mapAndThrow);
}

@Override
Expand All @@ -127,7 +127,7 @@ public CompletionStage<Boolean> supportsMultiDb(SecurityPlan securityPlan, Map<S
connectTimeoutMillis,
securityPlan,
AuthTokens.custom(boltValueFactory.toBoltMap(authMap)))
.exceptionally(errorMapper::mapAndTrow);
.exceptionally(errorMapper::mapAndThrow);
}

@Override
Expand All @@ -140,11 +140,11 @@ public CompletionStage<Boolean> supportsSessionAuth(SecurityPlan securityPlan, M
connectTimeoutMillis,
securityPlan,
AuthTokens.custom(boltValueFactory.toBoltMap(authMap)))
.exceptionally(errorMapper::mapAndTrow);
.exceptionally(errorMapper::mapAndThrow);
}

@Override
public CompletionStage<Void> close() {
return delegate.close().exceptionally(errorMapper::mapAndTrow);
return delegate.close().exceptionally(errorMapper::mapAndThrow);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static ErrorMapper getInstance() {

protected ErrorMapper() {}

<T> T mapAndTrow(Throwable throwable) {
<T> T mapAndThrow(Throwable throwable) {
throwable = map(throwable);
if (throwable instanceof RuntimeException runtimeException) {
throw runtimeException;
Expand Down