Throw exceptions on write failures.

Throw some error details to make debugging easier.

If anyone knows how Li3 typically handles error reporting from data sources, then I could do that instead.