sendError sends the given error to the client. This should generally never be called directly.
(err error)
| 1134 | |
| 1135 | // sendError sends the given error to the client. This should generally never be called directly. |
| 1136 | func (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. |
no test coverage detected