Skip to content

Instantly share code, notes, and snippets.

@thom4parisot
Forked from nfroidure/gist:4663042
Last active December 11, 2015 21:29
Show Gist options
  • Save thom4parisot/4663058 to your computer and use it in GitHub Desktop.
Save thom4parisot/4663058 to your computer and use it in GitHub Desktop.
// Chaining API for URIBuilder
var uri = new URLBuilder()
.parse('bad_url_format', loggerErrorHandler)
.addQueryParam('param','value')
.setPort('443')
.toString();
// How to handle the bad url parse error ?
// Don't want to throw exception
// Can't return null
function loggerErrorHandler(err, url_object){
console.log(err.message);
return url_object;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment