CenterForOpenScience / modular-file-renderer

A Python package for rendering files to HTML via an embeddable iframe
http://modular-file-renderer.readthedocs.io/en/latest/
Apache License 2.0
44 stars 67 forks source link

[SVCS-612] Add Tabular error for logs #339

Closed NyanHelsing closed 6 years ago

NyanHelsing commented 6 years ago

Ticket

https://openscience.atlassian.net/browse/SVCS-612

Purpose

This changes the logging message to include the name of the error that actually triggered it to assist in debugging tasks

Changes

Adds the nae of the error to the log message

Side effects

Better debugging

QA Notes

Deployment Notes

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.03%) to 71.177% when pulling 92d38267b8a1d48e8b1f737c9b3014b920f0ce65 on birdbrained:ft/better-tabular-errors into 62e0cde8ddc118c9d524b6cb783076a5ae33fc1f on CenterForOpenScience:develop.

cslzchen commented 6 years ago

A better example

With {!r}

screen shot 2018-06-12 at 2 25 45 pm
mfr.extensions.tabular.exceptions.UnexpectedFormattingError: 500, Unexpected formatting error. <EmptyTableError(400, Table empty or corrupt.)>

With {!s}

screen shot 2018-06-12 at 2 27 02 pm
mfr.extensions.tabular.exceptions.UnexpectedFormattingError: 500, Unexpected formatting error. 400, Table empty or corrupt.
cslzchen commented 6 years ago

As discussed with @birdbrained , we don't want the detailed error message goes to the user. So (1) the general error message remains the same (2) send a log to sentry (sentry.log()???) with detailed error message and stack trace.