Handle decompression errors
This commit is contained in:
@ -13,6 +13,7 @@ import routes/[
|
||||
unsupported, embed, resolver, router_utils]
|
||||
|
||||
const instancesUrl = "https://github.com/zedeus/nitter/wiki/Instances"
|
||||
const issuesUrl = "https://github.com/zedeus/nitter/issues"
|
||||
|
||||
let configPath = getEnv("NITTER_CONF_FILE", "./nitter.conf")
|
||||
let (cfg, fullCfg) = getConfig(configPath)
|
||||
@ -75,11 +76,15 @@ routes:
|
||||
error Http404:
|
||||
resp Http404, showError("Page not found", cfg)
|
||||
|
||||
error InternalError:
|
||||
echo error.exc.msg
|
||||
const link = a("open a GitHub issue", href = issuesUrl)
|
||||
resp Http500, showError(&"An error occurred, please {link} with the URL you tried to visit.", cfg)
|
||||
|
||||
error RateLimitError:
|
||||
echo error.exc.msg
|
||||
resp Http429, showError("Instance has been rate limited.<br>Use " &
|
||||
a("another instance", href = instancesUrl) &
|
||||
" or try again later.", cfg)
|
||||
const link = a("another instance", href = instancesUrl)
|
||||
resp Http429, showError(&"Instance has been rate limited.<br>Use {link} or try again later.", cfg)
|
||||
|
||||
extend unsupported, ""
|
||||
extend preferences, ""
|
||||
|
Reference in New Issue
Block a user