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.