github.com/Ingenico-ePayments/connect-sdk-go@v0.0.0-20240318153750-1f8cd329b9c9/errors/NotFoundError.go (about)

     1  package errors
     2  
     3  // NotFoundError indicates an exception that occurs when the requested resource is not found.
     4  // In normal usage of the SDK, this exception should not occur, however it is possible.
     5  // For example when path parameters are set with invalid values.
     6  type NotFoundError struct {
     7  	errorMessage  string
     8  	internalError error
     9  }
    10  
    11  // InternalError returns the internal error encountered
    12  func (nfe *NotFoundError) InternalError() error {
    13  	return nfe.internalError
    14  }
    15  
    16  // Error implements the Error interface
    17  func (nfe *NotFoundError) Error() string {
    18  	return nfe.String()
    19  }
    20  
    21  // String implements the Stringer interface
    22  // Format: 'errorMessage internalError'
    23  func (nfe *NotFoundError) String() string {
    24  	return nfe.errorMessage + " " + nfe.internalError.Error()
    25  }
    26  
    27  // NewNotFoundErrorVerbose creates a NotFoundError with the given errorMessage and internalError
    28  func NewNotFoundErrorVerbose(errorMessage string, internalError error) (*NotFoundError, error) {
    29  	return &NotFoundError{errorMessage, internalError}, nil
    30  }