errordata

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package errordata helps with error serialization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Internal

type Internal struct {
	Error  string  `json:"error,omitempty"` // Omitted if same as public error.
	Public *Public `json:"public,omitempty"`
}

Internal details of an error.

func Deconstruct

func Deconstruct(err error) *Internal

Deconstruct an error on best-effort basis.

func (*Internal) GetPublic

func (x *Internal) GetPublic() *Public

GetPublic representation which is well-formed even if there are no public details.

func (*Internal) Reconstruct

func (x *Internal) Reconstruct() error

Reconstruct an error.

type Module

type Module struct {
	UnexpectedEOF bool `json:"unexpected_eof,omitempty"`
}

Module error details.

type Public

type Public struct {
	Error         string         `json:"error"`
	Module        *Module        `json:"module,omitempty"`
	ResourceLimit *ResourceLimit `json:"resource_limit,omitempty"`
}

Public details of an error.

func (*Public) Reconstruct

func (x *Public) Reconstruct() error

Reconstruct an error without internal details.

type ResourceLimit

type ResourceLimit struct {
	BufferSizeExceeded bool `json:"buffer_size_exceeded,omitempty"`
}

ResourceLimit error details.

Jump to

Keyboard shortcuts

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