Provide more error information if available
Merge pull request #875 from wagenet/better-errors

Provide more error information if available