package errors
import "github.com/open-policy-agent/opa/internal/wasm/sdk/opa/errors"
Index ¶
- Constants
- func IsCancel(err error) bool
- func IsError(err error) bool
- func New(code, msg string) error
- type Error
Constants ¶
const ( // InvalidConfigErr is the error code returned if the OPA initialization fails due to an invalid config. InvalidConfigErr string = "invalid_config" // InvalidPolicyOrDataErr is the error code returned if either policy or data is invalid. InvalidPolicyOrDataErr string = "invalid_policy_or_data" // InvalidBundleErr is the error code returned if the bundle loaded is corrupted. InvalidBundleErr string = "invalid_bundle" // NotReadyErr is the error code returned if the OPA instance is not initialized. NotReadyErr string = "not_ready" // InternalErr is the error code returned if the evaluation fails due to an internal error. InternalErr string = "internal_error" // CancelledErr is the error code returned if the evaluation is cancelled. CancelledErr string = "cancelled" )
Functions ¶
func IsCancel ¶
IsCancel returns true if err was caused by cancellation.
func IsError ¶
IsError returns true if the err is an Error.
func New ¶
New returns a new error with the passed code
Types ¶
type Error ¶
Error is the error code type returned by the SDK functions when an error occurs.
func (*Error) Error ¶
func (*Error) Is ¶
Is allows matching error types using errors.Is (see IsCancel).
Source Files ¶
- Version
- v1.4.2 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 6 hours ago –
Tools for package owners.