Select Git revision
-
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
Ethan Reesor authoredCloses #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
}