code.dwrz.net

Go monorepo.
Log | Files | Refs

errors.go (483B)


      1 package ini
      2 
      3 import "fmt"
      4 
      5 // UnableToReadFile is an error indicating that a ini file could not be read
      6 type UnableToReadFile struct {
      7 	Err error
      8 }
      9 
     10 // Error returns an error message and the underlying error message if present
     11 func (e *UnableToReadFile) Error() string {
     12 	base := "unable to read file"
     13 	if e.Err == nil {
     14 		return base
     15 	}
     16 	return fmt.Sprintf("%s: %v", base, e.Err)
     17 }
     18 
     19 // Unwrap returns the underlying error
     20 func (e *UnableToReadFile) Unwrap() error {
     21 	return e.Err
     22 }