Skip to content

Commit

Permalink
refactor(ai): forward LoraLoadError to gateway (#211)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rickstaa authored Sep 22, 2024
1 parent bcd929d commit eb03c83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit eb03c83

Please sign in to comment.