From c68d7218a0642b2f7b62ea4e62dd7ca8c1633c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Tue, 16 Aug 2022 00:03:01 +0800 Subject: [PATCH] =?UTF-8?q?feat(exception):=E5=A2=9E=E5=8A=A0=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E8=A1=A8=E7=A4=BA=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E5=BC=82=E5=B8=B8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exceptions/illegal_arguments.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 exceptions/illegal_arguments.go diff --git a/exceptions/illegal_arguments.go b/exceptions/illegal_arguments.go new file mode 100644 index 0000000..8760a4d --- /dev/null +++ b/exceptions/illegal_arguments.go @@ -0,0 +1,19 @@ +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("Illegal Arguments, %s", e.Message) +}