正在显示
4 个修改的文件
包含
21 行增加
和
2 行删除
@@ -35,6 +35,12 @@ exports = module.exports = function(logger, settings) { | @@ -35,6 +35,12 @@ exports = module.exports = function(logger, settings) { | ||
35 | // set error type | 35 | // set error type |
36 | error.type = res.statusCode < 500 ? 'invalid_request_error' : 'api_error' | 36 | error.type = res.statusCode < 500 ? 'invalid_request_error' : 'api_error' |
37 | 37 | ||
38 | + if (_.isString(err.param)) { | ||
39 | + error.type = 'invalid_request_error' | ||
40 | + if (res.statusCode === 500) | ||
41 | + res.statusCode = 400 | ||
42 | + } | ||
43 | + | ||
38 | /* | 44 | /* |
39 | error.type = _.isString(err.param) ? 'invalid_request_error' : 'api_error' | 45 | error.type = _.isString(err.param) ? 'invalid_request_error' : 'api_error' |
40 | 46 |
lib/boot/knex.js
0 → 100644
1 | { | 1 | { |
2 | "name": "igloo", | 2 | "name": "igloo", |
3 | - "version": "0.0.4-rc.1", | 3 | + "version": "0.0.4-rc.2", |
4 | "description": "Igloo is a lightweight, fast, and minimal framework for rapid development", | 4 | "description": "Igloo is a lightweight, fast, and minimal framework for rapid development", |
5 | "main": "./lib", | 5 | "main": "./lib", |
6 | "repository": { | 6 | "repository": { |
@@ -19,8 +19,10 @@ | @@ -19,8 +19,10 @@ | ||
19 | "commander": "^2.2.0", | 19 | "commander": "^2.2.0", |
20 | "connect-redis": "~2.0.0", | 20 | "connect-redis": "~2.0.0", |
21 | "express-session": "^1.2.1", | 21 | "express-session": "^1.2.1", |
22 | + "knex": "^0.6.13", | ||
22 | "merge-defaults": "^0.1.0", | 23 | "merge-defaults": "^0.1.0", |
23 | "mongoose": "~3.8.7", | 24 | "mongoose": "~3.8.7", |
25 | + "mysql": "^2.3.2", | ||
24 | "to-camel-case": "^0.2.1", | 26 | "to-camel-case": "^0.2.1", |
25 | "underscore": "~1.6.0", | 27 | "underscore": "~1.6.0", |
26 | "update-notifier": "git://github.com/niftylettuce/update-notifier", | 28 | "update-notifier": "git://github.com/niftylettuce/update-notifier", |
请
注册
或
登录
后发表评论