From 986562c2c20b4b87010dfec893912bb4b99302f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Sat, 17 Jun 2023 09:37:09 +0800 Subject: [PATCH] =?UTF-8?q?enahnce(error):=E5=B0=86=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=AD=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=9B=B4=E6=94=B9=E4=B8=BA=E4=B8=AD=E6=96=87=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exceptions/auth.go | 2 +- exceptions/illegal_arguments.go | 2 +- exceptions/improper_operate.go | 2 +- exceptions/not_found.go | 2 +- exceptions/unsuccessful.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/exceptions/auth.go b/exceptions/auth.go index e452ceb..af0ed46 100644 --- a/exceptions/auth.go +++ b/exceptions/auth.go @@ -31,5 +31,5 @@ func NewUnauthorizedError(msg string) *UnauthorizedError { } func (e UnauthorizedError) Error() string { - return fmt.Sprintf("Unauthorized: %s", e.Message) + return fmt.Sprintf("用户未获得授权: %s", e.Message) } diff --git a/exceptions/illegal_arguments.go b/exceptions/illegal_arguments.go index 8760a4d..e6871ae 100644 --- a/exceptions/illegal_arguments.go +++ b/exceptions/illegal_arguments.go @@ -15,5 +15,5 @@ func NewIllegalArgumentsError(msg string, arguments ...string) IllegalArgumentsE } func (e IllegalArgumentsError) Error() string { - return fmt.Sprintf("Illegal Arguments, %s", e.Message) + return fmt.Sprintf("使用了非法参数, %s", e.Message) } diff --git a/exceptions/improper_operate.go b/exceptions/improper_operate.go index 4ac7626..f2fba06 100644 --- a/exceptions/improper_operate.go +++ b/exceptions/improper_operate.go @@ -15,5 +15,5 @@ func NewImproperOperateError(msg string, arguments ...string) ImproperOperateErr } func (e ImproperOperateError) Error() string { - return fmt.Sprintf("Improper Operate, %s", e.Message) + return fmt.Sprintf("操作不恰当, %s", e.Message) } diff --git a/exceptions/not_found.go b/exceptions/not_found.go index 14065ba..4bc8ae1 100644 --- a/exceptions/not_found.go +++ b/exceptions/not_found.go @@ -11,7 +11,7 @@ func NewNotFoundError(msg string) *NotFoundError { } func NewNotFoundErrorFromError(msg string, err error) *NotFoundError { - return &NotFoundError{Message: fmt.Sprintf("%s,%v", msg, err)} + return &NotFoundError{Message: fmt.Sprintf("所需数据未找到,%s,%v", msg, err)} } func (e NotFoundError) Error() string { diff --git a/exceptions/unsuccessful.go b/exceptions/unsuccessful.go index 22a9da9..0309658 100644 --- a/exceptions/unsuccessful.go +++ b/exceptions/unsuccessful.go @@ -7,5 +7,5 @@ func NewUnsuccessfulOperationError() *UnsuccessfulOperationError { } func (UnsuccessfulOperationError) Error() string { - return "Unsuccessful Operation" + return "操作不成功。" }