Simplify error handling

Depending on what you're looking for, you could also use anyhow::Result<u32>, which will wrap any error you like and not require creating any types. You can still get a specific error type out of it if you need to (using downcasting), and in the common case where all errors just get reported without being matched on, you don't need to do anything at all.

Might that give you the reduced boilerplate you're looking for?

2 Likes