| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| package vdl |
| |
| // WireError is the wire representation for the built-in error type. Errors and |
| // exceptions in each programming environment are converted to this type to |
| // ensure wire compatibility. Generated code for each environment provides |
| // automatic conversions into idiomatic native representations. |
| type WireError struct { |
| Id string // Error Id, used to uniquely identify each error. |
| RetryCode WireRetryCode // Retry behavior suggested for the receiver. |
| Msg string // Error message, may be empty. |
| ParamList []any // Variadic parameters contained in the error. |
| } |
| |
| // WireRetryCode is the suggested retry behavior for the receiver of an error. |
| // If the receiver doesn't know how to handle the specific error, it should |
| // attempt the suggested retry behavior. |
| type WireRetryCode enum { |
| NoRetry // Do not retry. |
| RetryConnection // Renew high-level connection/context. |
| RetryRefetch // Refetch and retry (e.g., out of date HTTP ETag) |
| RetryBackoff // Backoff and retry a finite number of times. |
| } |