|
@@ -44,28 +44,16 @@ module.exports = options => {
|
|
|
yield next;
|
|
yield next;
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
// 输出错误到日志
|
|
// 输出错误到日志
|
|
|
- if (err.stack) {
|
|
|
|
|
- this.logger.error(err);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.getLogger('fail').info(JSON.stringify({
|
|
|
|
|
- error: err,
|
|
|
|
|
- project: this.session.sessionProject,
|
|
|
|
|
- user: this.session.sessionUser,
|
|
|
|
|
- body: this.session.body,
|
|
|
|
|
- }));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.log(err);
|
|
|
// 重定向值标段管理
|
|
// 重定向值标段管理
|
|
|
if (this.helper.isAjax(this.request)) {
|
|
if (this.helper.isAjax(this.request)) {
|
|
|
- if (err.stack) {
|
|
|
|
|
- this.body = {err: 4, msg: '标段数据未知错误', data: null};
|
|
|
|
|
- } else {
|
|
|
|
|
- this.body = {err: 3, msg: err.toString(), data: null};
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.ajaxErrorBody(err, '标段数据未知错误');
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ this.postError(err, '标段数据未知错误');
|
|
|
if (this.helper.isWap(this.request)) {
|
|
if (this.helper.isWap(this.request)) {
|
|
|
this.redirect('/wap/subproj');
|
|
this.redirect('/wap/subproj');
|
|
|
} else {
|
|
} else {
|
|
|
- err === '您无权查看该内容' ? this.redirect(this.request.headers.referer) : this.redirect(`/sp/${ctx.subProject.id}/list`);
|
|
|
|
|
|
|
+ this.redirect(this.request.headers.referer);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|