Documentation
¶
Overview ¶
Package pgstatus converts postgres errors to gRPC statuses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Code ¶
Code converts a database error into a gRPC codes.Code.
Postgres: https://www.postgresql.org/docs/current/static/errcodes-appendix.html GRPC: https://godoc.org/google.golang.org/grpc/codes
func ConditionName ¶
ConditionName for SQLStatus() interface error code.
func Convert ¶
Convert is a convenience function which removes the need to handle the boolean return value from FromError.
func FromError ¶
FromError returns a gRPC status.Status representing an err if it was produced from status package, has a method `GRPCStatus() *status.Status` or has a method SQLState interface returning a postgres error code. Otherwise, ok is false and a Status is returned with codes.Unknown and the original error message.