From 3891d97c64ca7a709095488f19b839c11d188593 Mon Sep 17 00:00:00 2001 From: Mohsen Mirzakhani Date: Fri, 30 Aug 2024 21:54:44 +0200 Subject: [PATCH] fix: remove post request error dialog (#76) * fix: remove post request error dialog --- ui/pages/requests/controller.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/pages/requests/controller.go b/ui/pages/requests/controller.go index 7b29820..ecdd9ca 100644 --- a/ui/pages/requests/controller.go +++ b/ui/pages/requests/controller.go @@ -228,7 +228,9 @@ func (c *Controller) onPostRequestSetChanged(id string, statusCode int, item, fr func (c *Controller) setPreviewFromResponse(id string, responseData *domain.HTTPResponseDetail, fromKey string) { resp, err := rest.GetJSONPATH(responseData.Response, fromKey) if err != nil { - c.view.showError(fmt.Errorf("failed to get data from response, %w", err)) + // TODO show error without interrupting the user + fmt.Println("failed to get data from response, %w", err) + // c.view.showError(fmt.Errorf("failed to get data from response, %w", err)) return } @@ -238,6 +240,8 @@ func (c *Controller) setPreviewFromResponse(id string, responseData *domain.HTTP if result, ok := resp.(string); ok { c.view.SetPostRequestSetPreview(id, result) + } else { + c.view.SetPostRequestSetPreview(id, fmt.Sprintf("%v", resp)) } }