refactor getFields method

This commit is contained in:
Simon Martín 2018-03-27 15:56:53 +02:00
parent cdeb8b8e63
commit 0998e50014

View File

@ -22,10 +22,11 @@ ErrorHandler.prototype.getMessage = function() {
};
ErrorHandler.prototype.getFields = function() {
return ['detail', 'hint', 'context'].reduce(function (previousValue, current) {
previousValue[current] = this.err[current];
return previousValue;
}.bind(this), {});
return {
detail: this.err.detail,
hint: this.err.hint,
context: this.err.context,
};
};
ErrorHandler.prototype.getStatus = function() {