From a6964f4d8a9df9d72869d134d1749b41ea110606 Mon Sep 17 00:00:00 2001 From: GongXian Cao Date: Thu, 10 Mar 2016 14:41:50 +0800 Subject: [PATCH] add error codes --- index.js | 16 ++++++++++++++++ package.json | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 index.js create mode 100644 package.json diff --git a/index.js b/index.js new file mode 100644 index 0000000..17e90b8 --- /dev/null +++ b/index.js @@ -0,0 +1,16 @@ +module.exports = { + '-1' : 'system busy, retry later', + 0 : 'success', + 1 : 'internal error, contact us', + 10007: 'invalid token', + 10008: 'token is expired', + 10010: 'require token', + 11001: 'require username', + 11002: 'require password', + 11003: 'user not exist', + 11004: 'password not match', + 11005: 'failed to generate token, contact us', + 11006: 'failed to create user', + 11007: 'failed to hash password', + 11008: 'failed to save user, please check if required field is correct' +}; \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..758121f --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "mlop-errors", + "version": "1.0.0", + "description": "micro-location open platform errors", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/cloudnapps/mlop-errors.git" + }, + "author": "GongXian Cao", + "license": "ISC", + "bugs": { + "url": "https://github.com/cloudnapps/mlop-errors/issues" + }, + "homepage": "https://github.com/cloudnapps/mlop-errors#readme" +}