...

Source file src/edge-infra.dev/pkg/sds/lib/systemd/systemdconfig/errors.go

Documentation: edge-infra.dev/pkg/sds/lib/systemd/systemdconfig

     1  package systemdconfig
     2  
     3  import (
     4  	"errors"
     5  	"fmt"
     6  )
     7  
     8  var (
     9  	errSystemdConfigSyntax        = errors.New("syntax error in systemd config data")
    10  	errSectionHeaderSyntax        = errors.New("invalid section header, expected '[Section]'")
    11  	errKeySyntax                  = errors.New("invalid characters in key, expected [A-Za-z0-9-]")
    12  	errValueSyntax                = errors.New("invalid value, cannot contain '#' or ';'")
    13  	errMultiLineValuesUnsupported = errors.New("found '\\', multiline values are not supported by this package")
    14  )
    15  
    16  type SyntaxError struct {
    17  	Context string
    18  	Err     error
    19  }
    20  
    21  func (err *SyntaxError) Error() string {
    22  	return fmt.Sprintf("%s: %v", err.Context, err.Err)
    23  }
    24  
    25  type UnsupportedError struct {
    26  	Context string
    27  	Err     error
    28  }
    29  
    30  func (err *UnsupportedError) Error() string {
    31  	return fmt.Sprintf("%s: %v", err.Context, err.Err)
    32  }
    33  

View as plain text