Simplified CLI errors

This commit is contained in:
Eduard Urbach 2025-02-07 20:08:49 +01:00
parent a296ee8c94
commit a562f521b6
Signed by: eduard
GPG key ID: 49226B848C78F6C8
6 changed files with 43 additions and 51 deletions

View file

@ -1,13 +0,0 @@
package errors
import "fmt"
// ExpectedCLIParameter error is created when a command line parameter is missing.
type ExpectedCLIParameter struct {
Parameter string
}
// Error generates the string representation.
func (err *ExpectedCLIParameter) Error() string {
return fmt.Sprintf("Expected parameter '%s'", err.Parameter)
}

View file

@ -1,14 +0,0 @@
package errors
import "fmt"
// InvalidParameterValue error is created when a parameter has an invalid value.
type InvalidParameterValue struct {
Value string
Parameter string
}
// Error generates the string representation.
func (err *InvalidParameterValue) Error() string {
return fmt.Sprintf("Invalid value '%s' for parameter '%s'", err.Value, err.Parameter)
}

View file

@ -1,13 +0,0 @@
package errors
import "fmt"
// UnknownCLIParameter error is created when a command line parameter is not recognized.
type UnknownCLIParameter struct {
Parameter string
}
// Error generates the string representation.
func (err *UnknownCLIParameter) Error() string {
return fmt.Sprintf("Unknown parameter '%s'", err.Parameter)
}