(msg, level, fatal)
| 139 | } |
| 140 | |
| 141 | function makeError(msg, level, fatal) { |
| 142 | const err = new Error(msg); |
| 143 | if (typeof level === 'boolean') { |
| 144 | fatal = level; |
| 145 | err.level = 'protocol'; |
| 146 | } else { |
| 147 | err.level = level || 'protocol'; |
| 148 | } |
| 149 | err.fatal = !!fatal; |
| 150 | return err; |
| 151 | } |
| 152 | |
| 153 | function writeUInt32BE(buf, value, offset) { |
| 154 | buf[offset++] = (value >>> 24); |