diff options
author | gennyble <gen@nyble.dev> | 2025-02-23 02:17:04 -0600 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2025-02-23 02:17:04 -0600 |
commit | f5f103404857fb4f21cf71ac72fd5aa88baed95a (patch) | |
tree | 307b34dbd4ee0cf9c5fd565f97c346cf6363f4e4 | |
parent | dca67275a75a10ce2b2472ddffca157a114a008c (diff) | |
download | awake-f5f103404857fb4f21cf71ac72fd5aa88baed95a.tar.gz awake-f5f103404857fb4f21cf71ac72fd5aa88baed95a.zip |
Log 404s as warnings
-rw-r--r-- | TODO | 7 | ||||
-rwxr-xr-x | src/main.rs | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/TODO b/TODO index 6aae58a..caba2e8 100644 --- a/TODO +++ b/TODO @@ -39,4 +39,9 @@ about specifically, will allow it to be drawn over the larger one so it will let us see most of both fo them. This is working now with TX/RX because we do more TX than RX, but that could - change and I would rather have it switch with smartness. \ No newline at end of file + change and I would rather have it switch with smartness. + +(7) Stick 404's in the database + Mostly because I think it would be funny to see all the weird + endpoints the crawlers hit, and a bit to know what links I've + killed over the course of time. \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index c036324..b2ac1e9 100755 --- a/src/main.rs +++ b/src/main.rs @@ -147,6 +147,13 @@ async fn handler( ) -> Response { match falible_handler(state, fs, settings, sid, rfr, path).await { Ok(resp) => resp, + Err(RuntimeError::NotFound { source: _, path }) => { + tracing::warn!("[{sid}] 404 on {path}"); + + Response::builder() + .body(Body::from(format!("the path was not found: {path}"))) + .unwrap() + } Err(re) => Response::builder() .body(Body::from(re.to_string())) .unwrap(), |