error.mx raw

   1  // Copyright (c) 2013-2021 The btcsuite developers
   2  // Copyright (c) 2015-2021 The Decred developers
   3  
   4  package btcec
   5  
   6  import (
   7  	"smesh.lol/pkg/nostr/ec/secp256k1"
   8  )
   9  
  10  // Error identifies an error related to public key cryptography using a
  11  // sec256k1 curve. It has full support for errors.Is and errors.As, so the
  12  // caller can ascertain the specific reason for the error by checking the
  13  // underlying error.
  14  type Error = secp256k1.Error
  15  
  16  // ErrorKind identifies a kind of error. It has full support for errors.Is and
  17  // errors.As, so the caller can directly check against an error kind when
  18  // determining the reason for an error.
  19  type ErrorKind = secp256k1.ErrorKind
  20  
  21  // makeError creates an secp256k1.Error given a set of arguments.
  22  func makeError(kind ErrorKind, desc string) Error {
  23  	return Error{Err: kind, Description: string(append([]byte(nil), desc...))}
  24  }
  25