Errors

Error types and how to handle each kind.

All SDK errors implement the nevo.Error interface:

type Error interface {
	error
	IsTransient() bool
}

Narrow with errors.As.

Types

type AuthError      struct { Message string }
type RequestError   struct { StatusCode int; Code, Message string }
type ServerError    struct { StatusCode int; Message string }
type NetworkError   struct { Message string; Cause error }
type UnsupportedChannelError struct { Channel string }
type ReplyError     struct { StatusCode int; Code, Message string }
TypeWhenIsTransient()
*AuthError401 / 403 — invalid or revoked token.false
*RequestError4xx — client-side, don’t retry.false
*ServerError5xx after internal retries.true
*NetworkErrorTransport failure after retries.true
*UnsupportedChannelErrorChannel doesn’t accept this op.false
*ReplyErrorSuperclass for reply-specific failures.Inherits.

Usage

_, err := client.Reply(ctx, event, nevo.ReplyParams{Text: "hi"})
if err != nil {
	var authErr *nevo.AuthError
	if errors.As(err, &authErr) {
		return err // terminal — stop
	}
	var nevoErr nevo.Error
	if errors.As(err, &nevoErr) && nevoErr.IsTransient() {
		// queue for retry later
		return nil
	}
	return err
}

Stream errors

client.Run(ctx):

  • Returns context.Canceled or context.DeadlineExceeded when the caller’s context ends — normal shutdown.
  • Returns *nevo.AuthError if the server rejects the token at any point. Terminal — reconnection does not retry.
  • Other transient network blips are handled internally by reconnecting with exponential jittered backoff. No error surfaces at the application layer.