diff options
author | Profpatsch <mail@profpatsch.de> | 2024-08-18T15·30+0200 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2024-09-13T11·13+0000 |
commit | b800bf2bd4dc8b4e0d54131c240a41f6c149680f (patch) | |
tree | fb2bb96e81db00414541c29709eecd8bebde1b44 /users/Profpatsch/openlab-tools | |
parent | e9f1bb9917faf963b013f5cf5f47cc3667cb372a (diff) |
fix(users/Profpatsch/whatcd-resolver): pretty AppException r/8675
AppException would be a console-pretty-printed version for http errors, which would print all the escape codes in the jaeger traces of the exception, making it more-or-less unreadable. So instead, let’s make AppException two cases, an ErrorTree case which is printed as-is (no color), and a “Pretty” case which is printed using the pretty module (colors on console, no colors in otel). Somewhat involved, I guess this is temporary until I figure out what is really needed. Change-Id: Iff4a8651c5f5368a5b798541efc19cc7ab9de34b Reviewed-on: https://cl.tvl.fyi/c/depot/+/12232 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
Diffstat (limited to 'users/Profpatsch/openlab-tools')
-rw-r--r-- | users/Profpatsch/openlab-tools/src/OpenlabTools.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/users/Profpatsch/openlab-tools/src/OpenlabTools.hs b/users/Profpatsch/openlab-tools/src/OpenlabTools.hs index 16f1b626ac10..7ba52c30229d 100644 --- a/users/Profpatsch/openlab-tools/src/OpenlabTools.hs +++ b/users/Profpatsch/openlab-tools/src/OpenlabTools.hs @@ -389,7 +389,7 @@ httpJson opts span parser req = do | statusCode == 200, Nothing <- contentType -> Left [fmt|Server returned a body with unspecified content type|] - | code <- statusCode -> Left [fmt|Server returned an non-200 error code, code {code}: {resp & showPretty}|] + | code <- statusCode -> Left $ singleError [fmt|Server returned an non-200 error code, code {code}: {[pretty resp] & prettyErrsNoColor}|] ) >>= assertM span |