1 line
5.0 KiB
JSON
1 line
5.0 KiB
JSON
{"remainingRequest":"/var/www/html/payroll_manager/front-end/node_modules/thread-loader/dist/cjs.js??ref--4-2!/var/www/html/payroll_manager/front-end/node_modules/ts-loader/index.js??ref--4-3!/var/www/html/payroll_manager/front-end/node_modules/tslint-loader/index.js!/var/www/html/payroll_manager/front-end/src/main/webapp/app/config/error-middleware.ts","dependencies":[{"path":"/var/www/html/payroll_manager/front-end/src/main/webapp/app/config/error-middleware.ts","mtime":1533613270881},{"path":"/var/www/html/payroll_manager/front-end/node_modules/react-hot-loader/webpack.js","mtime":1505850161000},{"path":"/var/www/html/payroll_manager/front-end/node_modules/cache-loader/dist/cjs.js","mtime":0},{"path":"/var/www/html/payroll_manager/front-end/node_modules/thread-loader/dist/cjs.js","mtime":0},{"path":"/var/www/html/payroll_manager/front-end/node_modules/ts-loader/index.js","mtime":1530127508000},{"path":"/var/www/html/payroll_manager/front-end/node_modules/tslint-loader/index.js","mtime":1519899048000}],"contextDependencies":[],"result":["import { isPromise } from 'react-jhipster';\nvar getErrorMessage = function (errorData) {\n var message = errorData.message;\n if (errorData.fieldErrors) {\n errorData.fieldErrors.forEach(function (fErr) {\n message += \"\\nfield: \" + fErr.field + \", Object: \" + fErr.objectName + \", message: \" + fErr.message + \"\\n\";\n });\n }\n return message;\n};\nexport default (function () { return function (next) { return function (action) {\n // If not a promise, continue on\n if (!isPromise(action.payload)) {\n return next(action);\n }\n /**\n *\n * The error middleware serves to dispatch the initial pending promise to\n * the promise middleware, but adds a `catch`.\n * It need not run in production\n */\n if (process.env.NODE_ENV === 'development') {\n // Dispatch initial pending promise, but catch any errors\n return next(action).catch(function (error) {\n console.error(action.type + \" caught at middleware with reason: \" + JSON.stringify(error.message) + \".\");\n if (error && error.response && error.response.data) {\n var message = getErrorMessage(error.response.data);\n console.error(\"Actual cause: \" + message);\n }\n return Promise.reject(error);\n });\n }\n return next(action);\n}; }; });\n",{"version":3,"file":"/var/www/html/payroll_manager/front-end/src/main/webapp/app/config/error-middleware.ts","sourceRoot":"","sources":["/var/www/html/payroll_manager/front-end/node_modules/tslint-loader/index.js!/var/www/html/payroll_manager/front-end/src/main/webapp/app/config/error-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,IAAM,eAAe,GAAG,UAAA,SAAS;IAC/B,IAAI,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;IAChC,IAAI,SAAS,CAAC,WAAW,EAAE;QACzB,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,UAAA,IAAI;YAChC,OAAO,IAAI,cAAY,IAAI,CAAC,KAAK,mBAAc,IAAI,CAAC,UAAU,mBAAc,IAAI,CAAC,OAAO,OAAI,CAAC;QAC/F,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,gBAAe,cAAM,OAAA,UAAA,IAAI,IAAI,OAAA,UAAA,MAAM;IACjC,gCAAgC;IAChC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;KACrB;IAED;;;;;OAKG;IACH,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;QAC1C,yDAAyD;QACzD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,UAAA,KAAK;YAC7B,OAAO,CAAC,KAAK,CAAI,MAAM,CAAC,IAAI,2CAAsC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,MAAG,CAAC,CAAC;YACpG,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE;gBAClD,IAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBACrD,OAAO,CAAC,KAAK,CAAC,mBAAiB,OAAS,CAAC,CAAC;aAC3C;YAED,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC,EAzB4B,CAyB5B,EAzBoB,CAyBpB,EAAC","sourcesContent":["import { isPromise } from 'react-jhipster';\n\nconst getErrorMessage = errorData => {\n let message = errorData.message;\n if (errorData.fieldErrors) {\n errorData.fieldErrors.forEach(fErr => {\n message += `\\nfield: ${fErr.field}, Object: ${fErr.objectName}, message: ${fErr.message}\\n`;\n });\n }\n return message;\n};\n\nexport default () => next => action => {\n // If not a promise, continue on\n if (!isPromise(action.payload)) {\n return next(action);\n }\n\n /**\n *\n * The error middleware serves to dispatch the initial pending promise to\n * the promise middleware, but adds a `catch`.\n * It need not run in production\n */\n if (process.env.NODE_ENV === 'development') {\n // Dispatch initial pending promise, but catch any errors\n return next(action).catch(error => {\n console.error(`${action.type} caught at middleware with reason: ${JSON.stringify(error.message)}.`);\n if (error && error.response && error.response.data) {\n const message = getErrorMessage(error.response.data);\n console.error(`Actual cause: ${message}`);\n }\n\n return Promise.reject(error);\n });\n }\n return next(action);\n};\n"]}]} |