Promises [should always be rejected with types that are instances of `Error`](https://github.com/w3ctag/promises-guide#rejection-reasons-should-be-errors), which `DOMError` (and thus `SocketError`) is not. A `DOMException` might be a better choice.