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 opened on Mar 19, 2025

View on GitHub
 (10 comments) (0 reactions) (1 assignee)Python (16,704 stars) (988 forks)batch import
feature/feature-flagsgood first issueteam/flags-platform

Description

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.

Contributor guide