mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-01 12:08:37 -04:00
Initial plumbing for moving to Redux
This commit is contained in:
27
js/actions/ErrorActions.js
Normal file
27
js/actions/ErrorActions.js
Normal file
@ -0,0 +1,27 @@
|
||||
var ErrorConstants = require('../constants/ErrorConstants');
|
||||
|
||||
var models = require('../models.js');
|
||||
var Error = models.Error;
|
||||
|
||||
function serverError(error) {
|
||||
return {
|
||||
type: ErrorConstants.ERROR_SERVER,
|
||||
error: error
|
||||
};
|
||||
}
|
||||
|
||||
function ajaxError(error) {
|
||||
var e = new Error();
|
||||
e.ErrorId = 5;
|
||||
e.ErrorString = "Request Failed: " + status + error;
|
||||
|
||||
return {
|
||||
type: ErrorConstants.ERROR_AJAX,
|
||||
error: e
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
serverError: serverError,
|
||||
ajaxError: ajaxError
|
||||
};
|
Reference in New Issue
Block a user