Closed rudigiesler closed 10 years ago
@justinvdm What should I use for throwing the error? I see that there are a few different types of errors in the jsbox API.
I think it would be fine to just throw a normal Error
. If you like, you could extend vumigo.utils.BaseError
with your own error type if you like (something like var JsboxLocationError = BaseError.extend(function(self) { ... });
), but I think a normal Error
should be fine.
@justinvdm How would I then catch the error during testing?
Good question. You could do something like:
return tester
...
.run()
.catch(function(e) {
assert(e instanceof Error);
assert.equal(e.message, ':(');
});
Thanks :cake: . Sent a pull request: https://github.com/praekelt/go-jsbox-location/pull/8
Minor comment, otherwise looks good.
:+1:
Need to add error checking for if an object that is specified in the parameters does not exist in the object received from gmaps.