Parser Errors: from Nil to Throws

Episode #176 • Jan 31, 2022 • Subscriber-Only

Let’s explore the topic of error handling. We will scrutinize how we model errors in our parsing library and the problems that have come out of it, and we will address these problems by changing the fundamental shape of the parser type.

Previous episode
Parser Errors: from Nil to Throws
Next episode
Locked

Unlock This Episode

Our Free plan includes 1 subscriber-only episode of your choice, plus weekly updates from our newsletter.

Sign in with GitHub

Introduction

Last week we finished up a series of episodes bringing result builders to our parsing library, and even released a whole new version of the library that converts everything to the new builder style. We showed that the builder syntax removes a lot of noise from building large, complex parsers and even unlocks new styles of API design that were not previously possible.

This week we are going to address another change to the library that will bring many ergonomic and quality-of-life improvements to using it. We are going to demonstrate how to add basic error handling to the fundamental shape of parsers, which will give us an opportunity to better describe what goes wrong when a parser fails.

The need for errors


References

Downloads

Get started with our free plan

Our free plan includes 1 subscriber-only episode of your choice, access to 62 free episodes with transcripts and code samples, and weekly updates from our newsletter.

View plans and pricing