diff --git a/server/callback.go b/server/callback.go index 2e14dfd..b9ff325 100644 --- a/server/callback.go +++ b/server/callback.go @@ -47,12 +47,14 @@ func (r CallbackResponse) Response() router.Response { return &r } -type UnimplementedCallbackServer struct{} +type UnimplementedCallbackServer struct { + *ErrorHandler +} func (UnimplementedCallbackServer) mustEmbedUnimplementedCallbackServer() {} -func (UnimplementedCallbackServer) Callback(req *CallbackRequestBuilder) (res *CallbackResponse, errRes router.ErrorResponse) { - errRes = &ErrorHandler{router.DefaultErrorNotImplemented} +func (u UnimplementedCallbackServer) Callback(req *CallbackRequestBuilder) (res *CallbackResponse, errRes router.ErrorResponse) { + errRes = u.ErrorResponse(router.DefaultErrorNotImplemented) return } diff --git a/server/token.go b/server/token.go index 0e7bf28..8213648 100644 --- a/server/token.go +++ b/server/token.go @@ -52,12 +52,14 @@ func (r TokenResponse) Response() router.Response { return &r } -type UnimplementedTokenServer struct{} +type UnimplementedTokenServer struct { + *ErrorHandler +} func (UnimplementedTokenServer) mustEmbedUnimplementedTokenServer() {} -func (UnimplementedTokenServer) Token(req *TokenRequestBuilder) (res *TokenResponse, errRes router.ErrorResponse) { - errRes = &ErrorHandler{router.DefaultErrorNotImplemented} +func (u UnimplementedTokenServer) Token(req *TokenRequestBuilder) (res *TokenResponse, errRes router.ErrorResponse) { + errRes = u.ErrorResponse(router.DefaultErrorNotImplemented) return }