TurboGears / backlash

Standalone WebOb port of the Werkzeug Debugger with Python3 support born as a WebError replacement for TurboGears2
MIT License
13 stars 11 forks source link

Quietly ignoring trace_errors.error_email if no trace_errors.from_address #16

Closed kiilerix closed 4 years ago

kiilerix commented 4 years ago

It took me quite some time to figure out why email error reporting from TG2 (Kallithea) didn't work. It passed the checks to enable the email reporter, but it took the quiet exit in https://github.com/TurboGears/backlash/blob/master/backlash/tracing/reporters/mail.py#L35 because I didn't have from_address configured.

Please, could it log it as error when taking the early out. Or if you don't want logging in that module, perhaps just assert so we get a nice exception.

amol- commented 4 years ago

Oh yeah, it never changed from the past and it was required to allow people to disable email reporting by omitting those fields in the configuration.

Now the EmailReporter is only built if you explicitly enabled it, so I think it could even raise an exception if you didn't provide the minimum required options.

amol- commented 4 years ago

https://github.com/TurboGears/backlash/commit/edd12eed042cd8fbb422a0dd65cc4a62aee441ba and https://github.com/TurboGears/tg2/commit/39a63b1e4518790d139b72fa1b7d0140a244f87e should ensure that TG does error if backlash email reporter is not properly configured.

kiilerix commented 4 years ago

Looks good. Thanks.