package exceptions import "fmt" type IllegalArgumentsError struct { Message string Arguments []string } func NewIllegalArgumentsError(msg string, arguments ...string) IllegalArgumentsError { return IllegalArgumentsError{ Message: msg, Arguments: arguments, } } func (e IllegalArgumentsError) Error() string { return fmt.Sprintf("使用了非法参数, %s", e.Message) }