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

Aperta il 19 mar 2025

Vedi su GitHub
 (10 commenti) (0 reazioni) (1 assegnatario)Python (16.704 star) (988 fork)batch import
feature/feature-flagsgood first issueteam/feature-flagsteam/flags-platform

Descrizione

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.

Guida contributor