Skip to main content

Centralized and standardized exceptions for network related events

We are planning to work on standardizing and providing centralized interception/middleware of network related events like: connection lost, timeout, target memory recycled, host not available

Graftcode Network Exceptions

Client-side Exceptions (thrown in the generated Graft client):

  • GraftConnectionRefusedException – Thrown when the remote Graftcode Gateway cannot be reached or is not listening on the configured endpoint (service down, incorrect host/port, or firewall blocking).

  • GraftConnectionTimeoutException – Connection attempt to the remote Graftcode Gateway timed out.

  • GraftUnknownHostException – DNS resolution failed for the target hostname.

  • GraftConnectionResetException – Connection was forcibly reset by the remote peer (common after service restart, crash, or load balancer drop).

  • GraftReadTimeoutException – Timeout occurred while waiting for a response from the remote method.

  • GraftWriteTimeoutException – Timeout occurred while sending the invocation request.

  • GraftTlsHandshakeException – TLS/SSL handshake failed (applies to wss:// endpoints).

  • GraftCertificateValidationException – Server certificate validation failed (expired, self-signed, hostname mismatch, or untrusted CA).

  • GraftWebSocketUpgradeFailedException – Failed to upgrade the HTTP connection to WebSocket.

  • GraftProtocolViolationException – Received malformed or invalid binary data according to the IIP/Hypertube protocol.

  • GraftInvocationTimeoutException – Remote method execution exceeded the configured timeout on the server side.

  • GraftDeserializationException – Failed to deserialize the response received from the remote service.

Gateway-side Exceptions (thrown by Graftcode Gateway gg):

  • GraftPortBindingException – Failed to bind to the configured port (port already in use).

  • GraftPermissionDeniedException – Insufficient permissions to bind to a privileged port (< 1024).

Base Class Recommendation
All network exceptions inherit from GraftNetworkException for unified handling and easy distinction between transient and permanent errors.

Status: In Progress

Log in to comment and vote

No comments yet

Be the first to share your thoughts.