error.go raw

   1  // Copyright (c) 2013-2017 The btcsuite developers
   2  // Copyright (c) 2015-2021 The Decred developers
   3  // Use of this source code is governed by an ISC
   4  // license that can be found in the LICENSE file.
   5  
   6  package schnorr
   7  
   8  import (
   9  	ecdsa_schnorr "github.com/decred/dcrd/dcrec/secp256k1/v4/schnorr"
  10  )
  11  
  12  // ErrorKind identifies a kind of error.  It has full support for errors.Is
  13  // and errors.As, so the caller can directly check against an error kind
  14  // when determining the reason for an error.
  15  type ErrorKind = ecdsa_schnorr.ErrorKind
  16  
  17  // Error identifies an error related to a schnorr signature. It has full
  18  // support for errors.Is and errors.As, so the caller can ascertain the
  19  // specific reason for the error by checking the underlying error.
  20  type Error = ecdsa_schnorr.Error
  21  
  22  // signatureError creates an Error given a set of arguments.
  23  func signatureError(kind ErrorKind, desc string) Error {
  24  	return Error{Err: kind, Description: desc}
  25  }
  26