From 4bb009f25bff9b20650eecd5fcf8374577348f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Mon, 30 Mar 2026 11:50:35 +0400 Subject: [PATCH] Handle validation errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- pkg/server/api/console/v1/v1_resolver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/server/api/console/v1/v1_resolver.go b/pkg/server/api/console/v1/v1_resolver.go index ce41e89aa..bbb0c825e 100644 --- a/pkg/server/api/console/v1/v1_resolver.go +++ b/pkg/server/api/console/v1/v1_resolver.go @@ -4754,7 +4754,9 @@ func (r *mutationResolver) UpdateDocumentVersionContent(ctx context.Context, inp if _, ok := errors.AsType[*probo.ErrDocumentVersionNotDraft](err); ok { return nil, gqlutils.Conflict(ctx, err) } - + if validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok { + return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors) + } r.logger.ErrorCtx(ctx, "cannot update document version content", log.Error(err)) return nil, gqlutils.Internal(ctx) }