Custom error handling
Don't pass invalid JSON on errors
Document errorText
Merge pull request #12 from micho/feature/custom_error_handlers

Custom error handling