And here's how to do the same in plain JS with ES6, available now in node (--harmony) and (I believe?) Chrome Canary.
function *() {
try {
let body = yield request("https://x.io/");
return yield request("https://x.io/?q=" + body.hash);
} catch (e) {
// do what you like with the error
}
}