Replace call to error with throwIO. Fixes #2

* error would crash the server
* IO exception should result in a 500
Bump version