examples/oauth-client/oauth/provider.js
function check(err, res, body) {
    if (err) {
        return this.machine(err);
    }
    var obj;
    try {
        obj = JSON.parse(body);
    } catch (e) {
        return this.machine(new Error('Failed to parse as JSON (' + e.message + ') the text: ' + body));
    }
    if (res.statusCode !== 200) {
        return this.machine(obj);
    }
    this.machine(err, obj);
}
function check(err, res, body) {
    if (err) {
        return this.machine(err);
    }
    var obj;
    try {
        obj = JSON.parse(body);
    } catch (e) {
        return this.machine(new Error('Failed to parse as JSON (' + e.message + ') the text: ' + body));
    }
    if (res.statusCode !== 200) {
        return this.machine(obj);
    }
    this.machine(err, obj);
}
function check ( err , res , body ) { if ( err ) { return this . machine ( err ) ; } var obj ; try { obj = JSON . parse ( body ) ; } catch ( e ) { return this . machine ( new Error ( 'Failed to parse as JSON (' + e . message + ') the text: ' + body ) ) ; } if ( res . statusCode !== 200 ) { return this . machine ( obj ) ; } this . machine ( err , obj ) ; }
Callback for 'request'. Checks response
Callback for request . Checks response