MCPcopy Create free account
hub / github.com/dolthub/doltgresql / sendError

Method sendError

server/connection_handler.go:1136–1147  ·  view source on GitHub ↗

sendError sends the given error to the client. This should generally never be called directly.

(err error)

Source from the content-addressed store, hash-verified

1134
1135// sendError sends the given error to the client. This should generally never be called directly.
1136func (h *ConnectionHandler) sendError(err error) {
1137 fmt.Println(err.Error())
1138 if sendErr := h.send(&pgproto3.ErrorResponse{
1139 Severity: string(ErrorResponseSeverity_Error),
1140 Code: "XX000", // internal_error for now
1141 Message: err.Error(),
1142 }); sendErr != nil {
1143 // If we're unable to send anything to the connection, then there's something wrong with the connection and
1144 // we should terminate it. This will be caught in HandleConnection's defer block.
1145 panic(sendErr)
1146 }
1147}
1148
1149// convertQuery takes the given Postgres query, and converts it as an ast.ConvertedQuery that will work with the handler.
1150// If the query string contains multiple queries, then multiple ConvertedQuery will be returned.

Callers 1

endOfMessagesMethod · 0.95

Calls 2

sendMethod · 0.95
ErrorMethod · 0.45

Tested by

no test coverage detected