Display error if dsl query fails hard

By making failure more explicit, it's easier for us to debug the type of
failure
This commit is contained in:
Gabriel Horner
2022-03-02 21:31:20 -05:00
committed by Andelf
parent 669a56911e
commit 4eaca080dd
2 changed files with 15 additions and 6 deletions

View File

@@ -517,11 +517,18 @@
(take @sample (shuffle col)))
identity)
transform-fn (comp sort-by random-samples)]
(react/react-query repo
{:query query
:query-string query-string}
{:use-cache? false
:transform-fn transform-fn}))))))))))
(try
(react/react-query repo
{:query query
:query-string query-string
:throw-exception true}
{:use-cache? false
:transform-fn transform-fn})
(catch ExceptionInfo e
;; Allow non-existent page queries to be ignored
(if (string/includes? (str (.-message e)) "Nothing found for entity")
(log/error :query-dsl-error e)
(throw e)))))))))))))
(defn custom-query
[repo query-m query-opts]