Extract error handling from Strata.

Closes #6.