<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Rust on mephisto.cc</title><link>https://mephisto.cc/zh-tw/tags/rust/</link><description>Recent content in Rust on mephisto.cc</description><generator>Hugo -- gohugo.io</generator><language>zh-tw</language><copyright>Copyright © 2021-2022 mephisto.cc. All rights reserved.</copyright><lastBuildDate>Wed, 28 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://mephisto.cc/zh-tw/tags/rust/index.xml" rel="self" type="application/rss+xml"/><item><title>使用Trapfall收集錯誤信息</title><link>https://mephisto.cc/zh-tw/tech/trapfall/</link><pubDate>Wed, 28 Oct 2026 00:00:00 +0000</pubDate><guid>https://mephisto.cc/zh-tw/tech/trapfall/</guid><description>
昨天在看項目訪問日誌的時候，發現了個異常。 一個新疆·喀什用戶 POST 請求 422, 哪個接口大部分時候應該是觸發 400, FastAPI 的 422 是在路由函數執行之前，由內置異常處理器拋出的，路由內部代碼還沒跑，普通日誌拿不到原始請求體。 想要專門捕獲 Pydantic 校驗失敗（422），拿到完整報錯 + 原始請求 body，或者 5xx 等錯誤，定位代碼塊，拿到請求 body 什麼的，通常需要 Sentry 等專業方案
&lt;p&gt;&lt;a href="https://mephisto.cc/zh-tw/tech/trapfall/"&gt;閱讀更多&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>