Simplified CLI errors

This commit is contained in:
2025-02-07 20:08:49 +01:00
parent c2d1084434
commit 5fc9cc4dff
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)
}