docs.rs
docs.rs copied to clipboard
show "source file too big" when fetching source files that are bigger than our limit
We regularly see errors in our source views where the file size extends our configured Config::max_file_size or Config::max_file_size_html.
Since we're currently not streaming the content, and we do syntax hilighting on these files, we limit the size.
In case of the respective error (error::SizeLimitReached), we could show a better error to the user instead of just "error fetching source file". Also we don't need this to be a server error and reported as such.
This is an example file that is too big: https://docs.rs/crate/qt_core/latest/source/ritual_db_v1.json, we have more in sentry
- the respective handler is
web::source::source_browser_handler - using
templates/crate/source.htmlas template.
@syphar hi, I want to take a look into this issue as a newbie.
~I couldn't find signature you have mentioned above searching entire code in this repo. Could you provide me with more specific suggestion about this?~
EDIT: I've cloned and searched in different repo, I may be able to find it, sorry for that!
this is awesome, thank you for the help! will look at the PR
I think this issue can be closed for now 😂 I misused the closing keywords...
Very true, thanks!