...

Source file src/github.com/cli/go-gh/v2/pkg/config/errors.go

Documentation: github.com/cli/go-gh/v2/pkg/config

     1  package config
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // InvalidConfigFileError represents an error when trying to read a config file.
     8  type InvalidConfigFileError struct {
     9  	Path string
    10  	Err  error
    11  }
    12  
    13  // Allow InvalidConfigFileError to satisfy error interface.
    14  func (e *InvalidConfigFileError) Error() string {
    15  	return fmt.Sprintf("invalid config file %s: %s", e.Path, e.Err)
    16  }
    17  
    18  // Allow InvalidConfigFileError to be unwrapped.
    19  func (e *InvalidConfigFileError) Unwrap() error {
    20  	return e.Err
    21  }
    22  
    23  // KeyNotFoundError represents an error when trying to find a config key
    24  // that does not exist.
    25  type KeyNotFoundError struct {
    26  	Key string
    27  }
    28  
    29  // Allow KeyNotFoundError to satisfy error interface.
    30  func (e *KeyNotFoundError) Error() string {
    31  	return fmt.Sprintf("could not find key %q", e.Key)
    32  }
    33  

View as plain text