Expose more meaningful errors

adds `reason`, `statusCode` and `json` to the error object