Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

I'm not yet sure why, but some exceptions are neither logged to tomcat, nor to dspace.log, nor to the output HTML.

Example: As mentioned above, the python requests library fails with error: java.util.zip.DataFormatException: invalid stored block lengths

...

Code Block
languagepy
title\[dspace\]/webapps-jython/err_example.py
# -*- coding: utf-8 -*-

from javax.servlet.http import HttpServlet
import requests


class err_example(HttpServlet):
    def doGet(self, request, response):
        toClient = response.getWriter()
        try:
            r = requests.get('https://demo.dspace.org/rest/status')
        except:
            import sys, traceback
            traceback.print_exc(file=sys.stdout)  # log to catalina.out
            traceback.print_exc(file=toClient)  # log to HTML output

...