| 6165 | } |
| 6166 | if (ret === constants3.ERROR.OK) { |
| 6167 | return null; |
| 6168 | } |
| 6169 | if (ret === constants3.ERROR.PAUSED || ret === constants3.ERROR.PAUSED_UPGRADE) { |
| 6170 | this.paused = true; |
| 6171 | return null; |
| 6172 | } |
| 6173 | return this.createError(ret, EMPTY_BUF); |
| 6174 | } |
| 6175 | createError(ret, data) { |
| 6176 | const { llhttp, contentLength, bytesRead } = this; |
| 6177 | if (contentLength && bytesRead !== parseInt(contentLength, 10)) { |
| 6178 | return new ResponseContentLengthMismatchError(); |
| 6179 | } |
| 6180 | const ptr = llhttp.llhttp_get_error_reason(this.ptr); |
| 6181 | let message = ""; |
| 6182 | if (ptr) { |