PostHog/posthog

Clean up error handling across the board; need to make sure it's consistent everything and consistent with how we were handling errors in Django

Open

#30,174 建立於 2025年3月19日

在 GitHub 查看
 (10 留言) (0 反應) (1 負責人)Python (16,704 star) (988 fork)batch import
feature/feature-flagsgood first issueteam/flags-platform

描述

More context: when I first shipped the feature-flags rust service (at src/rust/feature-flags), I used thiserror for error-handling because I like how you could define typed enums with automatic trait implementations. It was my first time writing a rust application, and it seemed like a cool tool.

I was wrong. I mean, thiserror worked, but it led to a bunch of overkill that I don't really need – a bunch of extra error handling code that doesn't do much but exists to satisfy the compiler. thiserror is great for writing rust libraries, but anyhow is a much better choice for rust applications.

So, this task is to basically port all of the error handling in the feature-flags module to use anyhow instead of thiserror, while still keeping the client interface (i.e. the actual responses the app sends to anyone calling the /flags endpoint) the same.

貢獻者指南