aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/xml/xml.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/web/xml/xml.ex')
-rw-r--r--lib/pleroma/web/xml/xml.ex14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/pleroma/web/xml/xml.ex b/lib/pleroma/web/xml/xml.ex
index da3f68ecb..df50aac9c 100644
--- a/lib/pleroma/web/xml/xml.ex
+++ b/lib/pleroma/web/xml/xml.ex
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.XML do
require Logger
@@ -25,15 +29,15 @@ defmodule Pleroma.Web.XML do
{doc, _rest} =
text
|> :binary.bin_to_list()
- |> :xmerl_scan.string()
+ |> :xmerl_scan.string(quiet: true)
doc
- catch
- :exit, _error ->
+ rescue
+ _e ->
Logger.debug("Couldn't parse XML: #{inspect(text)}")
:error
- rescue
- e ->
+ catch
+ :exit, _error ->
Logger.debug("Couldn't parse XML: #{inspect(text)}")
:error
end