I’ve always been pretty adament that handling errors in your projects should not be an afterthought. This hasn’t changed, so I wanted to write a little post about error handling in your Ktor projects.
Losing my sanity after switching from YAML to HOCON in a Ktor project
Ktor has become my go-to framework for all the projects I start these days. This week, I wanted to setup a simple API, so I went on the Ktor website and created a project with the extensions I needed. Except I made a mistake: I configured the project to use YAML instead of HOCON as the configuration format. It was an easy mistake to fix, but once I deployed my project… all hell broke loose and nothing made sense anymore.
Storing and Querying JSON in a Postgres Database with Exposed
A long long time ago, in a galaxy country far away, a young student was doing his final group presentation. They’d built a multiplayer fighting game that would run on the Nintendo DS (it was a long time ago) and web/desktop using Flash (long long time ago!). On one of the presentation slide, they mentioned that they’d used an XML database to store games data, which one of the judge took interest in. That student was quick on his feet, so he replied that it was super convenient because you could just query data, get pre-formatted XML back and send it directly to the clients. That was me, I was that student and it was complete bullshit. We’d given up on using an XML database a long time ago and decided to go back to MySQL, I’d just forgotten to update the schema in our slides. This blogpost has nothing to do with XML, but I’ve used Postgres to store JSON data recently, and it made me think about this story. Anyway, let’s dig in.
2025 - Week 14: The One Where The Weather Is Nice
We got a few days of perfect blue sky and “I don’t need a jacket” temperatures, which means going out for walks (sure, whatever) and long bike rides (hell yeah, I’m never walking anywhere ever again). It’s not enough to compensate for, well, everything else going on in the world right now, but it’s something. It did feel good to get back to my routine after the aftermath of COVID last week.
Unexpected surprise when changing the configuration of the JSON serializer in Ktor
As part of a refactoring, I broke something that shouldn’t have broken (should it ever?). Fortunately, I caught this issue in my tests, but it took me on a stroll into Ktor’s and kotlinx’ serialization’s source code, which then got me thinking about expectations when related to “default” values in public API.