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 }
| Type | When | IsTransient() |
|---|---|---|
*AuthError | 401 / 403 — invalid or revoked token. | false |
*RequestError | 4xx — client-side, don’t retry. | false |
*ServerError | 5xx after internal retries. | true |
*NetworkError | Transport failure after retries. | true |
*UnsupportedChannelError | Channel doesn’t accept this op. | false |
*ReplyError | Superclass 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.Canceledorcontext.DeadlineExceededwhen the caller’s context ends — normal shutdown. - Returns
*nevo.AuthErrorif 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.