failure

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Overview

Package failure defines a drop-in replacement for go-ucanto's failure module, with an extended FailureModel that can represent all the fields that may appear, so that decoding doesn't fail because of unexpected fields. This should ideally move to go-ucanto itself in some form, but it's a bit of a hack right now, and the entire issue will go away with the UCAN 1.0 version of go-ucanto.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailureType

func FailureType() schema.Type

Types

type FailureModel

type FailureModel struct {
	Name    *string
	Message string
	Stack   *string

	Audience            *ipld.Node //UCANPrincipal
	Capability          *ipld.Node //Capability
	Cause               *FailureModel
	Causes              *[]FailureModel
	Claimed             *ipld.Node //ParsedCapability
	Delegated           *ipld.Node //Any
	Delegation          *ipld.Node //Delegation
	DelegationErrors    *[]FailureModel
	Did                 *[]byte //DID
	ExpiredAt           *int64
	FailedProofs        *[]FailureModel
	InvalidProofs       *[]FailureModel
	Issuer              *ipld.Node //UCANPrincipal
	Link                *datamodel.Link
	UnknownCapabilities *[]ipld.Node //[]Capability
	ValidAt             *int64
	IsError             *bool
}

FailureModel is a generic failure

func (FailureModel) Error

func (f FailureModel) Error() string

func (*FailureModel) ToIPLD

func (f *FailureModel) ToIPLD() (ipld.Node, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL