()
| 2877 | } |
| 2878 | |
| 2879 | func (p *Pipeline) receiveMessage() (pgproto3.BackendMessage, error) { |
| 2880 | for { |
| 2881 | msg, err := p.conn.receiveMessage() |
| 2882 | if err != nil { |
| 2883 | p.err = err |
| 2884 | p.conn.asyncClose() |
| 2885 | return nil, normalizeTimeoutError(p.ctx, err) |
| 2886 | } |
| 2887 | |
| 2888 | switch msg := msg.(type) { |
| 2889 | case *pgproto3.ParameterStatus, *pgproto3.NoticeResponse, *pgproto3.NotificationResponse: |
| 2890 | // Filter these message types out in pipeline mode. The normal processing is handled by PgConn.receiveMessage. |
| 2891 | default: |
| 2892 | return msg, nil |
| 2893 | } |
| 2894 | } |
| 2895 | } |
| 2896 | |
| 2897 | func (p *Pipeline) handleUnexpectedMessage(errStr string, msg pgproto3.BackendMessage) error { |
| 2898 | p.err = fmt.Errorf("pipeline: %s: received unexpected message type %T", errStr, msg) |
no test coverage detected