Skip to content

Authentication Errors swallowed and never surfaced to places where you could handle the error #292

@bmcadams-datastax

Description

@bmcadams-datastax

When authenticating with the Pulsar builder, if authentication fails the library does log an internal error like:
[2023-08-22T18:36:09Z ERROR pulsar::connection] connection error, not retryable: [PulsarError(Some(AuthenticationError), Some("Failed to authenticate"))]
However, that AuthenticationError gets dropped on the floor and never passed out to the code calling the library. Instead, you get Connection(Io(Custom { kind: Other, error: "fatal error when connecting to the Pulsar server" })).

My code right now is identical to the producer example code, but i'm deliberately passing bad authentication info.

This isn't terribly useful for a developer using the library who wants to know that the reason for failure was Auth, and be able to handle it in their code.

My current use case is a command line tool that actually verifies a pulsar config, and needs to know that the error that occurred was because Auth failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions