airbnbapi icon indicating copy to clipboard operation
airbnbapi copied to clipboard

Better error handling

Open Technohacker opened this issue 5 years ago • 10 comments

For issue #5 Functions now throw Error objects instead of returning nulls

Potential issues:

  • Errors from request-promise and airbnbapi are both given back to the caller. More code may be necessary to give a unified interface
  • This would very likely be a breaking API change

This PR isn't intended to be merged right away until reviewed for more issues

Technohacker avatar Jun 12 '19 04:06 Technohacker

Pull Request Test Coverage Report for Build 50

  • 99 of 119 (83.19%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+6.9%) to 77.358%

Changes Missing Coverage Covered Lines Changed/Added Lines %
build/main.js 98 118 83.05%
<!-- Total: 99 119
Files with Coverage Reduction New Missed Lines %
build/log.js 1 47.83%
<!-- Total: 1
Totals Coverage Status
Change from base Build 49: 6.9%
Covered Lines: 217
Relevant Lines: 278

💛 - Coveralls

coveralls avatar Jun 12 '19 04:06 coveralls

That's brilliant! Thank you!

It looks like you may have edited the build files instead of the pre-babelised source code in the src directory. Totally understandable as I have neglected to write a contribution guide. My apologies.

How would you like to proceed?

zxol avatar Jun 12 '19 04:06 zxol

I've updated both (source then babelize), it's just that I didn't notice a gitignore for the build directory so I thought you kept both updated together :sweat_smile:

The only commit that affects the build files would be the last one so the rest can be used instead :D

Technohacker avatar Jun 12 '19 04:06 Technohacker

Ahh sorry, Understood.

zxol avatar Jun 12 '19 04:06 zxol

Did you write a script to help you refactor the code? I'm curious about your approach to the problem.

zxol avatar Jun 12 '19 04:06 zxol

To be honest I was changing lines manually :rofl: I used Atom so for a majority of the lines I used multi-cursor editing :)

Technohacker avatar Jun 12 '19 04:06 Technohacker

Nice :)

zxol avatar Jun 12 '19 04:06 zxol

I'll review this carefully and try to make some additions as well, prior to merging. Perhaps we should notify the users about an upcoming API surface change, too.

zxol avatar Jun 12 '19 04:06 zxol

Yes that's a good idea. I'll keep building with the API and add more endpoints if necessary so all of it can be made into one release :)

Technohacker avatar Jun 12 '19 04:06 Technohacker

Sounds good. I'm really glad to have a collaborator on the project.

zxol avatar Jun 12 '19 04:06 zxol