mirror of
https://github.com/aclindsa/moneygo.git
synced 2024-11-14 02:40:05 -05:00
18 lines
440 B
JavaScript
18 lines
440 B
JavaScript
|
var ErrorConstants = require('../constants/ErrorConstants');
|
||
|
|
||
|
var Error = require('../models').Error;
|
||
|
|
||
|
module.exports = function(state = new Error(), action) {
|
||
|
switch (action.type) {
|
||
|
case ErrorConstants.ERROR_AJAX:
|
||
|
case ErrorConstants.ERROR_SERVER:
|
||
|
case ErrorConstants.ERROR_CLIENT:
|
||
|
case ErrorConstants.ERROR_USER:
|
||
|
return action.error;
|
||
|
case ErrorConstants.CLEAR_ERROR:
|
||
|
return new Error();
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
};
|