Add `toJSON` method to `Error` prototype to allow errors to be logged properly (especially for rejected promises)
Merge branch 'feature/error_json'