Add ErrorHandler to UnimplementedServers

This commit is contained in:
some 2024-10-09 13:12:31 -04:00
parent b0f51d88c7
commit 756881cf14
Signed by: some
GPG Key ID: 65D0589220B9BFC8
2 changed files with 10 additions and 6 deletions

View File

@ -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
}

View File

@ -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
}