From eb03c8387b7fb759f410f995cbfe3891f3846025 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Mon, 23 Sep 2024 00:11:44 +0200 Subject: [PATCH] refactor(ai): forward LoraLoadError to gateway (#211) This commit ensures that LoraLoadError is properly forwarded to the gateway, allowing better visibility of issues. A more comprehensive error handling mechanism can be implemented in a future pull request. --- worker/worker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/worker.go b/worker/worker.go index dd001411..f1e176de 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -85,7 +85,7 @@ func (w *Worker) TextToImage(ctx context.Context, req GenTextToImageJSONRequestB return nil, err } slog.Error("text-to-image container returned 400", slog.String("err", string(val))) - return nil, errors.New("text-to-image container returned 400") + return nil, errors.New("text-to-image container returned 400: " + resp.JSON400.Detail.Msg) } if resp.JSON500 != nil { @@ -133,7 +133,7 @@ func (w *Worker) ImageToImage(ctx context.Context, req GenImageToImageMultipartR return nil, err } slog.Error("image-to-image container returned 400", slog.String("err", string(val))) - return nil, errors.New("image-to-image container returned 400") + return nil, errors.New("image-to-image container returned 400: " + resp.JSON400.Detail.Msg) } if resp.JSON500 != nil {