(cause: Cause.Cause<unknown>)
| 740 | Array.isArray(u) && u.length > 0 && u.every((error) => isObject(error) && "message" in error) |
| 741 | |
| 742 | const connectionError = (cause: Cause.Cause<unknown>): TransportError => { |
| 743 | const found = Cause.findError(cause) |
| 744 | if (Result.isFailure(found)) { |
| 745 | return new TransportError({ description: "The graphql-ws connection was closed" }) |
| 746 | } |
| 747 | const error = found.success |
| 748 | if (error instanceof TransportError) { |
| 749 | return error |
| 750 | } |
| 751 | if (Socket.isSocketError(error) && error.reason._tag === "SocketCloseError") { |
| 752 | return new TransportError({ |
| 753 | description: `The graphql-ws connection closed with ${error.reason.message}`, |
| 754 | closeCode: error.reason.code, |
| 755 | cause: error |
| 756 | }) |
| 757 | } |
| 758 | return new TransportError({ description: `The graphql-ws connection failed: ${errorMessage(error)}`, cause: error }) |
| 759 | } |
| 760 | |
| 761 | /** |
| 762 | * Builds the graphql-ws transport as an effect, for composing transports by |
no test coverage detected