X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/4f9f0e6fbf1be3805f9995c536a583eda1260bee..b264c171a5885976ef8f077be37e7cc83bf8a0fd:/apps/api/handlers/library_handlers.py?ds=sidebyside diff --git a/apps/api/handlers/library_handlers.py b/apps/api/handlers/library_handlers.py index f113834b..b7260674 100644 --- a/apps/api/handlers/library_handlers.py +++ b/apps/api/handlers/library_handlers.py @@ -232,8 +232,10 @@ class DocumentHTMLHandler(BaseHandler): return librarian.html.transform(document.data('xml'), is_file=False, parse_dublincore=False) except (EntryNotFound, RevisionNotFound), e: return response.EntityNotFound().django_response({ - 'exception': type(e), 'message': e.message}) - + 'reason': 'not-found', 'message': e.message}) + except librarian.ParseError, e: + return response.InternalError().django_response({ + 'reason': 'xml-parse-error', 'message': e.message }) # # Image Gallery