Skip to content

Commit 8d5d601

Browse files
authored
refactor: Fix typo in ErrorMapper.mapAndThrow method (#1643)
1 parent 61b3486 commit 8d5d601

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

driver/src/main/java/org/neo4j/driver/internal/adaptedbolt/AdaptingDriverBoltConnection.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,27 @@ final class AdaptingDriverBoltConnection implements DriverBoltConnection {
4242
public CompletionStage<Void> writeAndFlush(DriverResponseHandler handler, List<Message> messages) {
4343
return connection
4444
.writeAndFlush(new AdaptingDriverResponseHandler(handler, errorMapper, boltValueFactory), messages)
45-
.exceptionally(errorMapper::mapAndTrow);
45+
.exceptionally(errorMapper::mapAndThrow);
4646
}
4747

4848
@Override
4949
public CompletionStage<Void> write(List<Message> messages) {
50-
return connection.write(messages).exceptionally(errorMapper::mapAndTrow);
50+
return connection.write(messages).exceptionally(errorMapper::mapAndThrow);
5151
}
5252

5353
@Override
5454
public CompletionStage<Void> forceClose(String reason) {
55-
return connection.forceClose(reason).exceptionally(errorMapper::mapAndTrow);
55+
return connection.forceClose(reason).exceptionally(errorMapper::mapAndThrow);
5656
}
5757

5858
@Override
5959
public CompletionStage<Void> close() {
60-
return connection.close().exceptionally(errorMapper::mapAndTrow);
60+
return connection.close().exceptionally(errorMapper::mapAndThrow);
6161
}
6262

6363
@Override
6464
public CompletionStage<AuthInfo> authData() {
65-
return connection.authInfo().exceptionally(errorMapper::mapAndTrow);
65+
return connection.authInfo().exceptionally(errorMapper::mapAndThrow);
6666
}
6767

6868
@Override

driver/src/main/java/org/neo4j/driver/internal/adaptedbolt/AdaptingDriverBoltConnectionProvider.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public CompletionStage<DriverBoltConnection> connect(
9797
notificationConfig,
9898
databaseNameConsumer,
9999
additionalParameters)
100-
.exceptionally(errorMapper::mapAndTrow)
100+
.exceptionally(errorMapper::mapAndThrow)
101101
.thenApply(boltConnection -> new AdaptingDriverBoltConnection(
102102
boltConnection,
103103
routed ? new RoutedErrorMapper(boltConnection.serverAddress(), mode) : errorMapper,
@@ -114,7 +114,7 @@ public CompletionStage<Void> verifyConnectivity(SecurityPlan securityPlan, Map<S
114114
connectTimeoutMillis,
115115
securityPlan,
116116
AuthTokens.custom(boltValueFactory.toBoltMap(authMap)))
117-
.exceptionally(errorMapper::mapAndTrow);
117+
.exceptionally(errorMapper::mapAndThrow);
118118
}
119119

120120
@Override
@@ -127,7 +127,7 @@ public CompletionStage<Boolean> supportsMultiDb(SecurityPlan securityPlan, Map<S
127127
connectTimeoutMillis,
128128
securityPlan,
129129
AuthTokens.custom(boltValueFactory.toBoltMap(authMap)))
130-
.exceptionally(errorMapper::mapAndTrow);
130+
.exceptionally(errorMapper::mapAndThrow);
131131
}
132132

133133
@Override
@@ -140,11 +140,11 @@ public CompletionStage<Boolean> supportsSessionAuth(SecurityPlan securityPlan, M
140140
connectTimeoutMillis,
141141
securityPlan,
142142
AuthTokens.custom(boltValueFactory.toBoltMap(authMap)))
143-
.exceptionally(errorMapper::mapAndTrow);
143+
.exceptionally(errorMapper::mapAndThrow);
144144
}
145145

146146
@Override
147147
public CompletionStage<Void> close() {
148-
return delegate.close().exceptionally(errorMapper::mapAndTrow);
148+
return delegate.close().exceptionally(errorMapper::mapAndThrow);
149149
}
150150
}

driver/src/main/java/org/neo4j/driver/internal/adaptedbolt/ErrorMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static ErrorMapper getInstance() {
6262

6363
protected ErrorMapper() {}
6464

65-
<T> T mapAndTrow(Throwable throwable) {
65+
<T> T mapAndThrow(Throwable throwable) {
6666
throwable = map(throwable);
6767
if (throwable instanceof RuntimeException runtimeException) {
6868
throw runtimeException;

0 commit comments

Comments
 (0)