Skip to content

Error handling problem #28

Description

@myashchenko

I've implemented a small application that connects to Postgres via this driver. I have only one method that triggers database and this method looks like that:

@Override
public Mono<User> findByEmail(final String email) {
    try (final var session = dataSource.getSession()) {
        final var future = session.<List<Result.RowColumn>>rowOperation("select * from users where email = $1")
                    .set("$1", email, AdbaType.VARCHAR)
                    .collect(Collectors.toList())
                    .submit()
                    .getCompletionStage()
                    .thenApply(rc -> toUser(rc.get(0)))
                    .toCompletableFuture();
        return Mono.fromFuture(future);
    }
}

I have a running instance of PG database and the underlying DB schema doesn't have a "users" table. So when I execute the code above I expect to receive some user-friendly message like "Table 'users' doesn't exist". Instead of this, the method hangs and return neither error nor null. I tried to wait a few minutes but it continues hanging without returning any result.

Could you please advise if it is a bug in my code or a bug in the driver itself? Thank you

UPD
I use 0.1.0-ALPHA version of the library

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions