From 06b4ee7d2716f9cffef174ebc7428c055f02f310 Mon Sep 17 00:00:00 2001 From: atridadl Date: Sun, 7 Jan 2024 14:36:15 -0700 Subject: [PATCH] Better errors --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a28c87a..dff22c6 100644 --- a/main.go +++ b/main.go @@ -235,13 +235,13 @@ func (h *handler) cmdPic(ctx context.Context, data cmdroute.CommandData) *api.In test, ok := prediction.([]interface{}) if !ok { - return errorResponse(errors.New("prediction is not []interface{}")) + return errorResponse(errors.New("there was an error generating the image based on this prompt... this usually happens when the generated image violates safety requirements")) } imgUrl, ok := test[0].(string) if !ok { - return errorResponse(errors.New("prediction.Output[0] is not a string")) + return errorResponse(errors.New("there was an error generating the image based on this prompt... this usually happens when the generated image violates safety requirements")) } imageRes, imageGetErr := http.Get(imgUrl)