PyCon Sweden 2025

Nikita Churikov

Nikita Churikov is a Python developer at SciLifeLab in Stockholm with a background in applied mathematics and experience in machine learning projects. He is particularly passionate about deploying models and building reliable data pipelines. Currently, he works on a scientific hosting platform for life science researchers and contributes to PyCon Sweden as part of the organizing team. His interests include clean architecture and sustainable engineering practices that scale from hobby projects to production systems.


Session

10-30
16:00
30min
Designing Exceptions as an API: Hierarchies, Interfaces, and Error Codes
Nikita Churikov

Exceptions are often treated as an afterthought—until logs fill with cryptic stack traces and developers resort to except Exception: everywhere. In this talk, we’ll treat exceptions as a first-class API surface.

I’ll show how to design a clear exception hierarchy that distinguishes between user/validation errors, infrastructure failures, and unexpected bugs. We’ll explore how to define a lightweight interface (e.g. a status_code and optional metadata) so exceptions become predictable and machine-readable. Finally, we’ll see how stable domain error codes (like app.form.create.invalid_image_input) unlock better logging, monitoring, and user feedback.

Attendees will leave with a practical pattern they can apply to any Python project—web service, CLI, or library. This isn’t just about catching errors: it’s about designing recoverable, observable, and maintainable systems where exceptions aren’t noise but meaningful signals.

Auditorium