From 076c29e004f89b2556ff33ef420b6e9fb0069e82 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 24 Jun 2019 19:50:54 +0200 Subject: [PATCH] fix(backend): raise proper exception on input is binary data on svgparse --- backend/src/uxbox/services/svgparse.clj | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/uxbox/services/svgparse.clj b/backend/src/uxbox/services/svgparse.clj index 433f58c32..bf7487f74 100644 --- a/backend/src/uxbox/services/svgparse.clj +++ b/backend/src/uxbox/services/svgparse.clj @@ -67,8 +67,13 @@ (ex/raise :type :validation :code ::invalid-input :message "Input does not seems to be a valid svg.")) + + (catch org.jsoup.UncheckedIOException e + (ex/raise :type :validation + :code ::invalid-input + :message "Input does not seems to be a valid svg.")) + (catch Exception e - (.printStackTrace e) (ex/raise :code ::unexpected)))) ;; --- Public Api