Repository: ogen-go/ogen
Pull request #215 (2022-02-20 20:46:18)

feat: generate default implementation of Handler


Patch:
diff --git a/cmd/ogen/main.go b/cmd/ogen/main.go
index 79fcc4e9..83d565a6 100644
--- a/cmd/ogen/main.go
+++ b/cmd/ogen/main.go
@@ -33,17 +33,18 @@ func (t formattedSource) WriteFile(name string, content []byte) error {
 
 func main() {
 	var (
-		specPath       = flag.String("schema", "", "Path to openapi spec file")
-		targetDir      = flag.String("target", "api", "Path to target dir")
-		packageName    = flag.String("package", "api", "Target package name")
-		performFormat  = flag.Bool("format", true, "perform code formatting")
-		filterPath     = flag.String("filter-path", "", "Filter operations by path regex")
-		filterMethods  = flag.String("filter-methods", "", "Filter operations by HTTP methods (comma-separated)")
-		clean          = flag.Bool("clean", false, "Clean generated files before generation")
-		verbose        = flag.Bool("v", false, "verbose")
-		generateTests  = flag.Bool("generate-tests", false, "Generate tests based on schema examples")
-		skipTestsRegex = flag.String("skip-tests", "", "Skip tests matched by regex")
-		inferTypes     = flag.Bool("infer-types", false, "Infer schema types, if type is not defined explicitly")
+		specPath          = flag.String("schema", "", "Path to openapi spec file")
+		targetDir         = flag.String("target", "api", "Path to target dir")
+		packageName       = flag.String("package", "api", "Target package name")
+		performFormat     = flag.Bool("format", true, "perform code formatting")
+		filterPath        = flag.String("filter-path", "", "Filter operations by path regex")
+		filterMethods     = flag.String("filter-methods", "", "Filter operations by HTTP methods (comma-separated)")
+		clean             = flag.Bool("clean", false, "Clean generated files before generation")
+		verbose           = flag.Bool("v", false, "verbose")
+		generateTests     = flag.Bool("generate-tests", false, "Generate tests based on schema examples")
+		skipTestsRegex    = flag.String("skip-tests", "", "Skip tests matched by regex")
+		skipUnimplemented = flag.Bool("skip-unimplemented", false, "Disables generation of UnimplementedHandler")
+		inferTypes        = flag.Bool("infer-types", false, "Infer schema types, if type is not defined explicitly")
 
 		debugIgnoreNotImplemented = flag.String("debug.ignoreNotImplemented", "", "Ignore methods having functionality which is not implemented (all, oneOf, anyOf, allOf, nullable types, complex parameter types)")
 		debugNoerr                = flag.Bool("debug.noerr", false, "Ignore all errors")
@@ -119,9 +120,11 @@ func main() {
 		VerboseRoute:         *verbose,
 		GenerateExampleTests: *generateTests,
 		SkipTestRegex:        nil,
+		SkipUnimplemented:    *skipUnimplemented,
 		InferSchemaType:      *inferTypes,
 		Filters:              filters,
 		IgnoreNotImplemented: strings.Split(*debugIgnoreNotImplemented, ","),
+		NotImplementedHook:   nil,
 	}
 	if expr := *skipTestsRegex; expr != "" {
 		r, err := regexp.Compile(expr)
diff --git a/examples/ex_gotd/oas_handlers_gen.go b/examples/ex_gotd/oas_handlers_gen.go
index 49d1927c..ca65421e 100644
--- a/examples/ex_gotd/oas_handlers_gen.go
+++ b/examples/ex_gotd/oas_handlers_gen.go
@@ -103,6 +103,10 @@ func (s *Server) handleAddStickerToSetRequest(args [0]string, w http.ResponseWri
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -151,6 +155,10 @@ func (s *Server) handleAnswerCallbackQueryRequest(args [0]string, w http.Respons
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -199,6 +207,10 @@ func (s *Server) handleAnswerInlineQueryRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -247,6 +259,10 @@ func (s *Server) handleAnswerPreCheckoutQueryRequest(args [0]string, w http.Resp
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -295,6 +311,10 @@ func (s *Server) handleAnswerShippingQueryRequest(args [0]string, w http.Respons
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -343,6 +363,10 @@ func (s *Server) handleApproveChatJoinRequestRequest(args [0]string, w http.Resp
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -391,6 +415,10 @@ func (s *Server) handleBanChatMemberRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -439,6 +467,10 @@ func (s *Server) handleBanChatSenderChatRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -479,6 +511,10 @@ func (s *Server) handleCloseRequest(args [0]string, w http.ResponseWriter, r *ht
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -527,6 +563,10 @@ func (s *Server) handleCopyMessageRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -575,6 +615,10 @@ func (s *Server) handleCreateChatInviteLinkRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -623,6 +667,10 @@ func (s *Server) handleCreateNewStickerSetRequest(args [0]string, w http.Respons
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -671,6 +719,10 @@ func (s *Server) handleDeclineChatJoinRequestRequest(args [0]string, w http.Resp
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -719,6 +771,10 @@ func (s *Server) handleDeleteChatPhotoRequest(args [0]string, w http.ResponseWri
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -767,6 +823,10 @@ func (s *Server) handleDeleteChatStickerSetRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -815,6 +875,10 @@ func (s *Server) handleDeleteMessageRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -863,6 +927,10 @@ func (s *Server) handleDeleteMyCommandsRequest(args [0]string, w http.ResponseWr
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -911,6 +979,10 @@ func (s *Server) handleDeleteStickerFromSetRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -959,6 +1031,10 @@ func (s *Server) handleDeleteWebhookRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1007,6 +1083,10 @@ func (s *Server) handleEditChatInviteLinkRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1055,6 +1135,10 @@ func (s *Server) handleEditMessageCaptionRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1103,6 +1187,10 @@ func (s *Server) handleEditMessageLiveLocationRequest(args [0]string, w http.Res
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1151,6 +1239,10 @@ func (s *Server) handleEditMessageMediaRequest(args [0]string, w http.ResponseWr
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1199,6 +1291,10 @@ func (s *Server) handleEditMessageReplyMarkupRequest(args [0]string, w http.Resp
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1247,6 +1343,10 @@ func (s *Server) handleEditMessageTextRequest(args [0]string, w http.ResponseWri
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1295,6 +1395,10 @@ func (s *Server) handleExportChatInviteLinkRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1343,6 +1447,10 @@ func (s *Server) handleForwardMessageRequest(args [0]string, w http.ResponseWrit
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1391,6 +1499,10 @@ func (s *Server) handleGetChatRequest(args [0]string, w http.ResponseWriter, r *
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1439,6 +1551,10 @@ func (s *Server) handleGetChatAdministratorsRequest(args [0]string, w http.Respo
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1487,6 +1603,10 @@ func (s *Server) handleGetChatMemberRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1535,6 +1655,10 @@ func (s *Server) handleGetChatMemberCountRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1583,6 +1707,10 @@ func (s *Server) handleGetFileRequest(args [0]string, w http.ResponseWriter, r *
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1631,6 +1759,10 @@ func (s *Server) handleGetGameHighScoresRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1671,6 +1803,10 @@ func (s *Server) handleGetMeRequest(args [0]string, w http.ResponseWriter, r *ht
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1719,6 +1855,10 @@ func (s *Server) handleGetMyCommandsRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1767,6 +1907,10 @@ func (s *Server) handleGetStickerSetRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1815,6 +1959,10 @@ func (s *Server) handleGetUpdatesRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1863,6 +2011,10 @@ func (s *Server) handleGetUserProfilePhotosRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1903,6 +2055,10 @@ func (s *Server) handleGetWebhookInfoRequest(args [0]string, w http.ResponseWrit
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1951,6 +2107,10 @@ func (s *Server) handleLeaveChatRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1991,6 +2151,10 @@ func (s *Server) handleLogOutRequest(args [0]string, w http.ResponseWriter, r *h
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2039,6 +2203,10 @@ func (s *Server) handlePinChatMessageRequest(args [0]string, w http.ResponseWrit
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2087,6 +2255,10 @@ func (s *Server) handlePromoteChatMemberRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2135,6 +2307,10 @@ func (s *Server) handleRestrictChatMemberRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2183,6 +2359,10 @@ func (s *Server) handleRevokeChatInviteLinkRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2231,6 +2411,10 @@ func (s *Server) handleSendAnimationRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2279,6 +2463,10 @@ func (s *Server) handleSendAudioRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2327,6 +2515,10 @@ func (s *Server) handleSendChatActionRequest(args [0]string, w http.ResponseWrit
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2375,6 +2567,10 @@ func (s *Server) handleSendContactRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2423,6 +2619,10 @@ func (s *Server) handleSendDiceRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2471,6 +2671,10 @@ func (s *Server) handleSendDocumentRequest(args [0]string, w http.ResponseWriter
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2519,6 +2723,10 @@ func (s *Server) handleSendGameRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2567,6 +2775,10 @@ func (s *Server) handleSendInvoiceRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2615,6 +2827,10 @@ func (s *Server) handleSendLocationRequest(args [0]string, w http.ResponseWriter
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2663,6 +2879,10 @@ func (s *Server) handleSendMediaGroupRequest(args [0]string, w http.ResponseWrit
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2711,6 +2931,10 @@ func (s *Server) handleSendMessageRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2759,6 +2983,10 @@ func (s *Server) handleSendPhotoRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2807,6 +3035,10 @@ func (s *Server) handleSendPollRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2855,6 +3087,10 @@ func (s *Server) handleSendStickerRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2903,6 +3139,10 @@ func (s *Server) handleSendVenueRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2951,6 +3191,10 @@ func (s *Server) handleSendVideoRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2999,6 +3243,10 @@ func (s *Server) handleSendVideoNoteRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3047,6 +3295,10 @@ func (s *Server) handleSendVoiceRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3095,6 +3347,10 @@ func (s *Server) handleSetChatAdministratorCustomTitleRequest(args [0]string, w
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3143,6 +3399,10 @@ func (s *Server) handleSetChatDescriptionRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3191,6 +3451,10 @@ func (s *Server) handleSetChatPermissionsRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3239,6 +3503,10 @@ func (s *Server) handleSetChatPhotoRequest(args [0]string, w http.ResponseWriter
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3287,6 +3555,10 @@ func (s *Server) handleSetChatStickerSetRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3335,6 +3607,10 @@ func (s *Server) handleSetChatTitleRequest(args [0]string, w http.ResponseWriter
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3383,6 +3659,10 @@ func (s *Server) handleSetGameScoreRequest(args [0]string, w http.ResponseWriter
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3431,6 +3711,10 @@ func (s *Server) handleSetMyCommandsRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3479,6 +3763,10 @@ func (s *Server) handleSetPassportDataErrorsRequest(args [0]string, w http.Respo
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3527,6 +3815,10 @@ func (s *Server) handleSetStickerPositionInSetRequest(args [0]string, w http.Res
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3575,6 +3867,10 @@ func (s *Server) handleSetStickerSetThumbRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3623,6 +3919,10 @@ func (s *Server) handleSetWebhookRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3671,6 +3971,10 @@ func (s *Server) handleStopMessageLiveLocationRequest(args [0]string, w http.Res
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3719,6 +4023,10 @@ func (s *Server) handleStopPollRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3767,6 +4075,10 @@ func (s *Server) handleUnbanChatMemberRequest(args [0]string, w http.ResponseWri
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3815,6 +4127,10 @@ func (s *Server) handleUnbanChatSenderChatRequest(args [0]string, w http.Respons
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3863,6 +4179,10 @@ func (s *Server) handleUnpinAllChatMessagesRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3911,6 +4231,10 @@ func (s *Server) handleUnpinChatMessageRequest(args [0]string, w http.ResponseWr
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3959,6 +4283,10 @@ func (s *Server) handleUploadStickerFileRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
diff --git a/examples/ex_telegram/oas_handlers_gen.go b/examples/ex_telegram/oas_handlers_gen.go
index 49d1927c..ca65421e 100644
--- a/examples/ex_telegram/oas_handlers_gen.go
+++ b/examples/ex_telegram/oas_handlers_gen.go
@@ -103,6 +103,10 @@ func (s *Server) handleAddStickerToSetRequest(args [0]string, w http.ResponseWri
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -151,6 +155,10 @@ func (s *Server) handleAnswerCallbackQueryRequest(args [0]string, w http.Respons
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -199,6 +207,10 @@ func (s *Server) handleAnswerInlineQueryRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -247,6 +259,10 @@ func (s *Server) handleAnswerPreCheckoutQueryRequest(args [0]string, w http.Resp
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -295,6 +311,10 @@ func (s *Server) handleAnswerShippingQueryRequest(args [0]string, w http.Respons
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -343,6 +363,10 @@ func (s *Server) handleApproveChatJoinRequestRequest(args [0]string, w http.Resp
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -391,6 +415,10 @@ func (s *Server) handleBanChatMemberRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -439,6 +467,10 @@ func (s *Server) handleBanChatSenderChatRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -479,6 +511,10 @@ func (s *Server) handleCloseRequest(args [0]string, w http.ResponseWriter, r *ht
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -527,6 +563,10 @@ func (s *Server) handleCopyMessageRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -575,6 +615,10 @@ func (s *Server) handleCreateChatInviteLinkRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -623,6 +667,10 @@ func (s *Server) handleCreateNewStickerSetRequest(args [0]string, w http.Respons
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -671,6 +719,10 @@ func (s *Server) handleDeclineChatJoinRequestRequest(args [0]string, w http.Resp
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -719,6 +771,10 @@ func (s *Server) handleDeleteChatPhotoRequest(args [0]string, w http.ResponseWri
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -767,6 +823,10 @@ func (s *Server) handleDeleteChatStickerSetRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -815,6 +875,10 @@ func (s *Server) handleDeleteMessageRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -863,6 +927,10 @@ func (s *Server) handleDeleteMyCommandsRequest(args [0]string, w http.ResponseWr
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -911,6 +979,10 @@ func (s *Server) handleDeleteStickerFromSetRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -959,6 +1031,10 @@ func (s *Server) handleDeleteWebhookRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1007,6 +1083,10 @@ func (s *Server) handleEditChatInviteLinkRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1055,6 +1135,10 @@ func (s *Server) handleEditMessageCaptionRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1103,6 +1187,10 @@ func (s *Server) handleEditMessageLiveLocationRequest(args [0]string, w http.Res
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1151,6 +1239,10 @@ func (s *Server) handleEditMessageMediaRequest(args [0]string, w http.ResponseWr
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1199,6 +1291,10 @@ func (s *Server) handleEditMessageReplyMarkupRequest(args [0]string, w http.Resp
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1247,6 +1343,10 @@ func (s *Server) handleEditMessageTextRequest(args [0]string, w http.ResponseWri
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1295,6 +1395,10 @@ func (s *Server) handleExportChatInviteLinkRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1343,6 +1447,10 @@ func (s *Server) handleForwardMessageRequest(args [0]string, w http.ResponseWrit
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1391,6 +1499,10 @@ func (s *Server) handleGetChatRequest(args [0]string, w http.ResponseWriter, r *
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1439,6 +1551,10 @@ func (s *Server) handleGetChatAdministratorsRequest(args [0]string, w http.Respo
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1487,6 +1603,10 @@ func (s *Server) handleGetChatMemberRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1535,6 +1655,10 @@ func (s *Server) handleGetChatMemberCountRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1583,6 +1707,10 @@ func (s *Server) handleGetFileRequest(args [0]string, w http.ResponseWriter, r *
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1631,6 +1759,10 @@ func (s *Server) handleGetGameHighScoresRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1671,6 +1803,10 @@ func (s *Server) handleGetMeRequest(args [0]string, w http.ResponseWriter, r *ht
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1719,6 +1855,10 @@ func (s *Server) handleGetMyCommandsRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1767,6 +1907,10 @@ func (s *Server) handleGetStickerSetRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1815,6 +1959,10 @@ func (s *Server) handleGetUpdatesRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1863,6 +2011,10 @@ func (s *Server) handleGetUserProfilePhotosRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1903,6 +2055,10 @@ func (s *Server) handleGetWebhookInfoRequest(args [0]string, w http.ResponseWrit
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1951,6 +2107,10 @@ func (s *Server) handleLeaveChatRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -1991,6 +2151,10 @@ func (s *Server) handleLogOutRequest(args [0]string, w http.ResponseWriter, r *h
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2039,6 +2203,10 @@ func (s *Server) handlePinChatMessageRequest(args [0]string, w http.ResponseWrit
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2087,6 +2255,10 @@ func (s *Server) handlePromoteChatMemberRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2135,6 +2307,10 @@ func (s *Server) handleRestrictChatMemberRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2183,6 +2359,10 @@ func (s *Server) handleRevokeChatInviteLinkRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2231,6 +2411,10 @@ func (s *Server) handleSendAnimationRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2279,6 +2463,10 @@ func (s *Server) handleSendAudioRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2327,6 +2515,10 @@ func (s *Server) handleSendChatActionRequest(args [0]string, w http.ResponseWrit
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2375,6 +2567,10 @@ func (s *Server) handleSendContactRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2423,6 +2619,10 @@ func (s *Server) handleSendDiceRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2471,6 +2671,10 @@ func (s *Server) handleSendDocumentRequest(args [0]string, w http.ResponseWriter
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2519,6 +2723,10 @@ func (s *Server) handleSendGameRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2567,6 +2775,10 @@ func (s *Server) handleSendInvoiceRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2615,6 +2827,10 @@ func (s *Server) handleSendLocationRequest(args [0]string, w http.ResponseWriter
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2663,6 +2879,10 @@ func (s *Server) handleSendMediaGroupRequest(args [0]string, w http.ResponseWrit
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2711,6 +2931,10 @@ func (s *Server) handleSendMessageRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2759,6 +2983,10 @@ func (s *Server) handleSendPhotoRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2807,6 +3035,10 @@ func (s *Server) handleSendPollRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2855,6 +3087,10 @@ func (s *Server) handleSendStickerRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2903,6 +3139,10 @@ func (s *Server) handleSendVenueRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2951,6 +3191,10 @@ func (s *Server) handleSendVideoRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -2999,6 +3243,10 @@ func (s *Server) handleSendVideoNoteRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3047,6 +3295,10 @@ func (s *Server) handleSendVoiceRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3095,6 +3347,10 @@ func (s *Server) handleSetChatAdministratorCustomTitleRequest(args [0]string, w
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3143,6 +3399,10 @@ func (s *Server) handleSetChatDescriptionRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3191,6 +3451,10 @@ func (s *Server) handleSetChatPermissionsRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3239,6 +3503,10 @@ func (s *Server) handleSetChatPhotoRequest(args [0]string, w http.ResponseWriter
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3287,6 +3555,10 @@ func (s *Server) handleSetChatStickerSetRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3335,6 +3607,10 @@ func (s *Server) handleSetChatTitleRequest(args [0]string, w http.ResponseWriter
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3383,6 +3659,10 @@ func (s *Server) handleSetGameScoreRequest(args [0]string, w http.ResponseWriter
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3431,6 +3711,10 @@ func (s *Server) handleSetMyCommandsRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3479,6 +3763,10 @@ func (s *Server) handleSetPassportDataErrorsRequest(args [0]string, w http.Respo
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3527,6 +3815,10 @@ func (s *Server) handleSetStickerPositionInSetRequest(args [0]string, w http.Res
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3575,6 +3867,10 @@ func (s *Server) handleSetStickerSetThumbRequest(args [0]string, w http.Response
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3623,6 +3919,10 @@ func (s *Server) handleSetWebhookRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3671,6 +3971,10 @@ func (s *Server) handleStopMessageLiveLocationRequest(args [0]string, w http.Res
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3719,6 +4023,10 @@ func (s *Server) handleStopPollRequest(args [0]string, w http.ResponseWriter, r
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3767,6 +4075,10 @@ func (s *Server) handleUnbanChatMemberRequest(args [0]string, w http.ResponseWri
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3815,6 +4127,10 @@ func (s *Server) handleUnbanChatSenderChatRequest(args [0]string, w http.Respons
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3863,6 +4179,10 @@ func (s *Server) handleUnpinAllChatMessagesRequest(args [0]string, w http.Respon
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3911,6 +4231,10 @@ func (s *Server) handleUnpinChatMessageRequest(args [0]string, w http.ResponseWr
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -3959,6 +4283,10 @@ func (s *Server) handleUploadStickerFileRequest(args [0]string, w http.ResponseW
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
diff --git a/gen/_template/handlers.tmpl b/gen/_template/handlers.tmpl
index 6c86a684..917e9087 100644
--- a/gen/_template/handlers.tmpl
+++ b/gen/_template/handlers.tmpl
@@ -56,6 +56,10 @@ func (s *Server) handle{{ $op.Name }}Request(args [{{ $op.PathParamsCount }}]str
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		{{- else }}
 		respondError(w, http.StatusInternalServerError, err)
diff --git a/gen/_template/unimplemented.tmpl b/gen/_template/unimplemented.tmpl
new file mode 100644
index 00000000..663215f2
--- /dev/null
+++ b/gen/_template/unimplemented.tmpl
@@ -0,0 +1,30 @@
+{{- /*gotype: github.com/ogen-go/ogen/gen.TemplateConfig*/ -}}
+
+{{ define "unimplemented" }}
+{{ $pkg := $.Package }}
+{{ template "header" $ }}
+
+var _ Handler = UnimplementedHandler{}
+
+// UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
+type UnimplementedHandler struct {}
+
+{{- range $op := $.Operations }}
+// {{ $op.Name }} implements {{ $op.Spec.OperationID }} operation.
+//
+{{- template "godoc_def" $op.GoDoc }}
+// {{ $op.Spec.HTTPMethod }} {{ $op.Spec.Path }}
+func (UnimplementedHandler) {{ $op.Name }}(ctx context.Context {{ if $op.Request }}, req {{ $op.Request.Type.Go }}{{ end }}{{ if $op.Params }}, params {{ $op.Name }}Params {{ end }}) (r {{ $op.Response.Type.Go }}, _ error) {
+	return r, http.ErrNotImplemented
+}
+{{- end }}
+{{- if $.Error }}
+// NewError creates {{ $.ErrorType.Go }} from error returned by handler.
+//
+// Used for common default response.
+func (UnimplementedHandler) NewError(ctx context.Context, err error) (r {{ $.ErrorType.Go }}) {
+	return r
+}
+{{- end }}
+
+{{ end }}
diff --git a/gen/errors.go b/gen/errors.go
index b161f97a..2ded98d7 100644
--- a/gen/errors.go
+++ b/gen/errors.go
@@ -7,18 +7,22 @@ import (
 	"github.com/go-faster/errors"
 )
 
+// ErrNotImplemented reports that feature is not implemented.
 type ErrNotImplemented struct {
 	Name string
 }
 
+// Error implements error.
 func (e *ErrNotImplemented) Error() string {
 	return e.Name + " not implemented"
 }
 
+// ErrUnsupportedContentTypes reports that ogen does not support such content-type(s).
 type ErrUnsupportedContentTypes struct {
 	ContentTypes []string
 }
 
+// Error implements error.
 func (e *ErrUnsupportedContentTypes) Error() string {
 	return fmt.Sprintf("unsupported content types: [%s]", strings.Join(e.ContentTypes, ", "))
 }
@@ -56,26 +60,32 @@ func (g *Generator) fail(err error) error {
 	return err
 }
 
+// ErrParseSpec reports that specification parsing failed.
 type ErrParseSpec struct {
 	err error
 }
 
+// Unwrap implements errors.Wrapper.
 func (e *ErrParseSpec) Unwrap() error {
 	return e.err
 }
 
+// Error implements error.
 func (e *ErrParseSpec) Error() string {
 	return fmt.Sprintf("parse spec: %s", e.err)
 }
 
+// ErrBuildRouter reports that route tree building failed.
 type ErrBuildRouter struct {
 	err error
 }
 
+// Unwrap implements errors.Wrapper.
 func (e *ErrBuildRouter) Unwrap() error {
 	return e.err
 }
 
+// Error implements error.
 func (e *ErrBuildRouter) Error() string {
 	return fmt.Sprintf("build router: %s", e.err)
 }
diff --git a/gen/generator.go b/gen/generator.go
index 64f29b0e..2ced8bd1 100644
--- a/gen/generator.go
+++ b/gen/generator.go
@@ -13,6 +13,7 @@ import (
 	"github.com/ogen-go/ogen/internal/oas/parser"
 )
 
+// Generator is OpenAPI-to-Go generator.
 type Generator struct {
 	opt        Options
 	operations []*ir.Operation
@@ -21,16 +22,28 @@ type Generator struct {
 	router     Router
 }
 
+// Options is Generator options.
 type Options struct {
-	VerboseRoute         bool
+	// VerboseRoute whether to print routes.
+	VerboseRoute bool
+	// GenerateExampleTests whether to generate decoding tests using schema examples.
 	GenerateExampleTests bool
-	SkipTestRegex        *regexp.Regexp
-	InferSchemaType      bool
-	Filters              Filters
+	// SkipTestRegex is regex to skip generated tests.
+	SkipTestRegex *regexp.Regexp
+	// SkipUnimplemented disables generation of unimplemented Handler, like UnimplementedServer generated by gRPC.
+	SkipUnimplemented bool
+	// InferSchemaType enables type inference for schemas. Schema parser will try to detect schema type
+	// by its properties.
+	InferSchemaType bool
+	// Filters contains filters to skip operations.
+	Filters Filters
+	// IgnoreNotImplemented contains ErrNotImplemented messages to ignore.
 	IgnoreNotImplemented []string
-	NotImplementedHook   func(name string, err error)
+	// NotImplementedHook is hook for ErrNotImplemented errors.
+	NotImplementedHook func(name string, err error)
 }
 
+// Filters contains filters to skip operations.
 type Filters struct {
 	PathRegex *regexp.Regexp
 	Methods   []string
@@ -53,6 +66,7 @@ func (f Filters) accept(op *oas.Operation) bool {
 	return true
 }
 
+// NewGenerator creates new Generator.
 func NewGenerator(spec *ogen.Spec, opts Options) (*Generator, error) {
 	operations, err := parser.Parse(spec, opts.InferSchemaType)
 	if err != nil {
diff --git a/gen/write.go b/gen/write.go
index e0dcd0aa..09146ec7 100644
--- a/gen/write.go
+++ b/gen/write.go
@@ -192,14 +192,22 @@ func (g *Generator) WriteSource(fs FileSystem, pkgName string) error {
 		}
 	}
 
-	if g.opt.GenerateExampleTests {
-		name := "test_examples"
-		fileName := fmt.Sprintf("oas_%s_gen_test.go", name)
-		if err := w.Generate(name, fileName, cfg); err != nil {
-			return errors.Wrapf(err, "%s", name)
+	for _, optional := range []struct {
+		name    string
+		enabled bool
+	}{
+		{"test_examples", g.opt.GenerateExampleTests},
+		{"unimplemented", !g.opt.SkipUnimplemented},
+	} {
+		if optional.enabled {
+			name := optional.name
+			fileName := fmt.Sprintf("oas_%s_gen.go", name)
+			if err := w.Generate(name, fileName, cfg); err != nil {
+				return errors.Wrapf(err, "%s", name)
+			}
 		}
-	}
 
+	}
 	return nil
 }
 
diff --git a/http/errors.go b/http/errors.go
new file mode 100644
index 00000000..841a3b7e
--- /dev/null
+++ b/http/errors.go
@@ -0,0 +1,6 @@
+package http
+
+import "github.com/go-faster/errors"
+
+// ErrNotImplemented reports that handler is not implemented.
+var ErrNotImplemented = errors.New("not implemented")
diff --git a/internal/sample_err/oas_handlers_gen.go b/internal/sample_err/oas_handlers_gen.go
index 05f3539c..c14b0c0d 100644
--- a/internal/sample_err/oas_handlers_gen.go
+++ b/internal/sample_err/oas_handlers_gen.go
@@ -103,6 +103,10 @@ func (s *Server) handleDataCreateRequest(args [0]string, w http.ResponseWriter,
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}
@@ -143,6 +147,10 @@ func (s *Server) handleDataGetRequest(args [0]string, w http.ResponseWriter, r *
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}


Test patch:
diff --git a/internal/test_single_endpoint/oas_handlers_gen.go b/internal/test_single_endpoint/oas_handlers_gen.go
index 5e05bc0f..e4505cec 100644
--- a/internal/test_single_endpoint/oas_handlers_gen.go
+++ b/internal/test_single_endpoint/oas_handlers_gen.go
@@ -95,6 +95,10 @@ func (s *Server) handleProbeLivenessRequest(args [0]string, w http.ResponseWrite
 			encodeErrorResponse(*errRes, w, span)
 			return
 		}
+		if errors.Is(err, ht.ErrNotImplemented) {
+			respondError(w, http.StatusNotImplemented, err)
+			return
+		}
 		encodeErrorResponse(s.h.NewError(ctx, err), w, span)
 		return
 	}