(err)
| 70 | }; |
| 71 | |
| 72 | function rethrowNativeError(err) { |
| 73 | const match = err.message?.match(/^(\w+): ([\s\S]*)$/); |
| 74 | if (match) { |
| 75 | const [, code, message] = match; |
| 76 | const ErrorClass = errorClassMap[code]; |
| 77 | if (ErrorClass) { |
| 78 | throw new ErrorClass(message); |
| 79 | } |
| 80 | } |
| 81 | throw err; |
| 82 | } |
| 83 | |
| 84 | module.exports = { |
| 85 | rethrowNativeError, |
no outgoing calls
no test coverage detected
searching dependent graphs…