github.com/true-sqn/fabric@v2.1.1+incompatible/bccsp/idemixerrs.go (about)

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package bccsp
     8  
     9  import (
    10  	"fmt"
    11  )
    12  
    13  type IdemixIIssuerPublicKeyImporterErrorType int
    14  
    15  const (
    16  	IdemixIssuerPublicKeyImporterUnmarshallingError IdemixIIssuerPublicKeyImporterErrorType = iota
    17  	IdemixIssuerPublicKeyImporterHashError
    18  	IdemixIssuerPublicKeyImporterValidationError
    19  	IdemixIssuerPublicKeyImporterNumAttributesError
    20  	IdemixIssuerPublicKeyImporterAttributeNameError
    21  )
    22  
    23  type IdemixIssuerPublicKeyImporterError struct {
    24  	Type     IdemixIIssuerPublicKeyImporterErrorType
    25  	ErrorMsg string
    26  	Cause    error
    27  }
    28  
    29  func (r *IdemixIssuerPublicKeyImporterError) Error() string {
    30  	if r.Cause != nil {
    31  		return fmt.Sprintf("%s: %s", r.ErrorMsg, r.Cause)
    32  	}
    33  
    34  	return r.ErrorMsg
    35  }