From 06ca411e03646886ff5418e28cc132b1af1030d0 Mon Sep 17 00:00:00 2001 From: mountain Date: Wed, 4 Oct 2023 18:03:19 +0900 Subject: [PATCH] =?UTF-8?q?ErrorWithStatus=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server.go b/server.go index 506e0e4..e9a46f5 100644 --- a/server.go +++ b/server.go @@ -49,6 +49,14 @@ const ( ShutdownFlagIdle = ShutdownFlag(3) ) +type ErrorWithStatus struct { + StatusCode int +} + +func (e ErrorWithStatus) Error() string { + return fmt.Sprintf("%d", e.StatusCode) +} + type RpcReturnTypeInterface interface { Value() any Error() error