You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't loop forever if the template fails to render
Instead, panic, which only fails one request instead of sending the
server into an infinite loop.
This shouldn't ever happen in practice since error pages are tested in
CI, but it's nice just in case.
The panic looks like this:
```
2021/06/21 00:05:07 [ERROR] docs_rs::web::page::web_page: called ctry!() on an `Err` value: Error { kind: Msg("Failed to render 'error.html'"), source: Some(Error { kind: Msg("Variable `oops` not found in context while rendering 'error.html'"), source: None }) }
note: while attempting to fetch the route Url { generic_url: "http://localhost:3000/not_here" }
4: docs_rs::web::page::web_page::WebPage::into_response<docs_rs::web::ErrorPage>
at src\web\page\web_page.rs:74
5: docs_rs::web::error::{{impl}}::handle
at src\web\error.rs:78
6: iron::middleware::{{impl}}::handle
at C:\Users\Joshua Nelson\.cargo\registry\src\github.com-1ecc6299db9ec823\iron-0.6.1\src\middleware\mod.rs:395
10: docs_rs::web::{{impl}}::handle::{{closure}}
at src\web\mod.rs:241
11: enum$<core::result::Result<iron::response::Response, iron::error::IronError>>::or_else<iron::response::Response,iron::error::IronError,iron::error::IronError,closure-2>
at /rustc/cc77ba46fcb2d288aa01554b48cd586c5827c3dd\library\core\src\result.rs:770
12: docs_rs::web::{{impl}}::handle
at src\web\mod.rs:183
13: iron::iron::{{impl}}::handle<docs_rs::web::MainHandler>
at C:\Users\Joshua Nelson\.cargo\registry\src\github.com-1ecc6299db9ec823\iron-0.6.1\src\iron.rs:176
thread '<unnamed>' panicked at 'error while serving error page: Error { kind: Msg("Failed to render 'error.html'"), source: Some(Error { kind: Msg("Variable `oops` not found in context while rendering 'error.html'"), source: None }) }', src\web\page\web_page.rs:72:20
```
0 commit comments