pmaengineering / ppp-web

Web server and client application for Pretty PDF Printer, a package to convert XlsForms to human readable formats.
https://www.pma2020.org
MIT License
4 stars 4 forks source link

Warnings should not stop conversion #25

Closed joeflack4 closed 6 years ago

joeflack4 commented 6 years ago

Description

The ppp core and CLI (http://github.com/PMA-2020/ppp) creates warnings and errors. Errors are exceptions that are raised. Warnings are printed to stderr, but do not raise an exception. Currently, ppp-web does not convert a file if it sees a message in stderr. We should change that. It should only stop conversion if there is an Exception

Desired/expected behavior

If a warning is shown in Stderr, conversion should continue, and the warning message should appear in the browser.

example warning

Actual behavior

PPP-web thinks that it is an error, and cancels conversion. Message displayed also looks like an error.

should be warning not error

Additional information

I don't know why, but right now ppp.pma2020.org and ppp-staging.pma2020.org can convert the attached file. There isn't even an error message. However, if you clone this repo and run locally, and try to convert his file, you will see an error.

Where is the logic that handles errors/warnings located? I think it will help to look at views.py, around line 77:

# if ppp.ppp tool wrote something to stderr, we should show it to user
        if stderr:
            flash("STDERR:\n{}".format(stderr), "error")
            return redirect(url_for('index'))

Attachments

  1. warnings.xlsx.zip
joeflack4 commented 6 years ago

@bciar Try this one after finishing another issue.

joeflack4 commented 6 years ago

I'm going to move this into another issue.