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