nit: 
    return extend({}, error, {reason: reason});