invidious-mod-JP/src/invidious/helpers
saltycrys 3dac33ffba
Add backtraces to errors (#1498)
Error handling has been reworked to always go through the new `error_template`,
`error_json` and `error_atom` macros.
They all accept a status code followed by a string message or an exception
object. `error_json` accepts a hash with additional fields as third argument.

If the second argument is an exception a backtrace will be printed, if it is a
string only the string is printed. Since up till now only the exception message
was printed a new `InfoException` class was added for situations where no
backtrace is intended but a string cannot be used.

`error_template` with a string message automatically localizes the message.
Missing error translations have been collected in https://github.com/iv-org/invidious/issues/1497
`error_json` with a string message does not localize the message. This is the
same as previous behavior. If translations are desired for `error_json` they
can be added easily but those error messages have not been collected yet.

Uncaught exceptions previously only printed a generic message ("Looks like
you've found a bug in Invidious. [...]"). They still print that message
but now also include a backtrace.
2020-11-30 10:59:21 +01:00
..
errors.cr Add backtraces to errors (#1498) 2020-11-30 10:59:21 +01:00
handlers.cr Fix storyboards 2020-10-25 09:35:16 +01:00
helpers.cr revert: remove 'JSON.parse("' 2020-11-26 18:22:31 +01:00
i18n.cr Fix warnings in latest version of Crystal 2020-04-09 12:18:09 -05:00
json_filter.cr Implement "fields" parameter from the YouTube Data API (#429) 2019-03-30 20:18:34 -05:00
logger.cr Add support for log levels 2019-06-07 21:13:50 -05:00
macros.cr Fix warnings with latest version of Crystal 2020-07-26 10:59:31 -04:00
proxy.cr Use QUIC for connections to YouTube 2019-11-18 17:28:32 -05:00
signatures.cr Fix signature URL regex 2020-06-16 19:21:29 -05:00
static_file_handler.cr Support Crystal 0.35.0 2020-06-15 18:11:06 -05:00
tokens.cr Add backtraces to errors (#1498) 2020-11-30 10:59:21 +01:00
utils.cr Add support for polymer redesign 2020-06-15 18:18:04 -05:00