8000 Can "connect error" and "ssl error" be part of the public API? · Issue #118 · jackc/pgconn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Can "connect error" and "ssl error" be part of the public API? #118
Open
@rafiss

Description

@rafiss

I am working on a CLI tool that uses this library.

Currently, pgconn returns an untyped error for "server refused TLS." See

return nil, errors.New("server refused TLS connection")

This causes some friction, as I need conditional logic based on this error. The only way now is with string matching, which is not guaranteed to be stable across releases.

Can this instead be a public error const, like ErrTLSNotSupported?

Similarly, I need conditional logic for connection errors, but that error is private now. See

type connectError struct {

Can that struct be made publicly visible, similar to PgError?


If you agree, I don't mind working on the PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0