-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RMB-965: runSqlFile with failed Future on SQL failure #1118
Conversation
The existing PostgresClient#runSQLFile methods return a succeeded Future when an SQL statement fails. The database failure messages are returned as a List of String. This doesn't comply with the Future contract. Add a PostgresClient#runSqlFile(String sqlFile) method that returns a failed Future when an SQL statement fails.
asyncResultHandler.handle(io.vertx.core.Future.failedFuture(e.getMessage())); | ||
log.error("{}", e.getMessage(), e); | ||
asyncResultHandler.handle(Future.succeededFuture( | ||
PostAdminImportSQLResponse.respond500WithTextPlain(e.getMessage()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree what you have here uses futures the right way. Also, it looks like this isn't a breaking change to modules that rely on this method. Do I have that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
Kudos, SonarCloud Quality Gate passed! |
The existing PostgresClient#runSQLFile methods return a succeeded Future when an SQL statement fails. The database failure messages are returned as a List of String.
This doesn't comply with the Future contract.
Add a PostgresClient#runSqlFile(String sqlFile) method that returns a failed Future when an SQL statement fails.
This simplifies code including RMB production and test code.