0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

Merge pull request #5263 from penpot/niwinz-bugfix-3

 Prevent logging EOF exceptions on SSE responses
This commit is contained in:
Alejandro 2024-11-08 07:39:04 +01:00 committed by GitHub
commit 0981517bc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,6 +9,7 @@
(:refer-clojure :exclude [tap]) (:refer-clojure :exclude [tap])
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.exceptions :as ex]
[app.common.logging :as l] [app.common.logging :as l]
[app.common.transit :as t] [app.common.transit :as t]
[app.http.errors :as errors] [app.http.errors :as errors]
@ -60,13 +61,10 @@
(try (try
(let [result (handler)] (let [result (handler)]
(events/tap :end result)) (events/tap :end result))
(catch java.io.EOFException cause
(events/tap :error (errors/handle' cause request)))
(catch Throwable cause (catch Throwable cause
(l/err :hint "unexpected error on processing sse response" (events/tap :error (errors/handle' cause request))
:cause cause) (when-not (ex/instance? java.io.EOFException cause)
(events/tap :error (errors/handle' cause request))) (l/err :hint "unexpected error on processing sse response" :cause cause)))
(finally (finally
(sp/close! events/*channel*) (sp/close! events/*channel*)
(px/await! listener)))))))})) (px/await! listener)))))))}))