Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
  • release-1.4 protected
  • partial-merkle-tree
  • 3616-migrate-block-ledger
  • 3623-backport
  • hashed-time-locks
  • 3626-expose-simulator
  • 3640-mining-support
  • 3621-csv2yaml
  • eip712-mask
  • 3565-eip712-ethan
  • 3617-instrumentation-followup
  • database
  • database-benchmark-index
  • database-no-mutex
  • 3588-blockchain-specific-key-value-database
  • 3570-generalize-pki-types
  • 3600-fee-schedule-consistency
  • 3589-code-intelligence
  • proxy-data-entries
  • v1.4.1-snapshot
  • v1.4.1
  • v1.4.0
  • v1.4.0-alpha.1
  • v1.3.0
  • v1.3.0-rc.3
  • v1.2.13
  • v1.2.12
  • mexc-v1.2.11
  • v1.3.0-rc.2
  • v1.2.11
  • v1.2.10
  • v1.2.10-rc.8
  • v1.2.10-rc.7
  • v1.2.10-rc.6
  • v1.2.10-rc.5
  • v1.2.10-rc.4
  • v1.2.10-rc.3
  • v1.2.10-rc.2
  • mexc-v1.2.10-rc.2
40 results

inspect.go

  • Ethan Reesor's avatar
    23023dfc
    Update block queries [#3247] · 23023dfc
    Ethan Reesor authored
    Closes #3247. Updates API v3's block queries to A) include a list of blocks anchored into the block and B) return the correct list of block entries given the changes to anchoring made in 1.0.2.
    
    Changelog: feature
    23023dfc
    History
    Update block queries [#3247]
    Ethan Reesor authored
    Closes #3247. Updates API v3's block queries to A) include a list of blocks anchored into the block and B) return the correct list of block entries given the changes to anchoring made in 1.0.2.
    
    Changelog: feature
inspect.go 778 B
// Copyright 2023 The Accumulate Authors
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

package errors

import "errors"

// As calls stdlib errors.As.
func As(err error, target interface{}) bool { return errors.As(err, target) }

// Is calls stdlib errors.Is.
func Is(err, target error) bool { return errors.Is(err, target) }

// Unwrap calls stdlib errors.Unwrap.
func Unwrap(err error) error { return errors.Unwrap(err) }

// Code returns the status code if the error is an [Error], or 0.
func Code(err error) Status {
	var err2 *Error
	if !As(err, &err2) {
		return 0
	}
	for err2.Code == UnknownError && err2.Cause != nil {
		err2 = err2.Cause
	}
	return err2.Code
}