Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/small-tou/sns-error-info
整理各SNS平台的错误码所对应的英文和中文描述,可自己扩展,方便在应用中错误提示,也可以当做手册查询
https://github.com/small-tou/sns-error-info
Last synced: 7 days ago
JSON representation
整理各SNS平台的错误码所对应的英文和中文描述,可自己扩展,方便在应用中错误提示,也可以当做手册查询
- Host: GitHub
- URL: https://github.com/small-tou/sns-error-info
- Owner: small-tou
- Created: 2012-12-21T08:29:23.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-21T09:05:06.000Z (almost 12 years ago)
- Last Synced: 2024-04-15T02:48:56.694Z (7 months ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
sns-error-info
==============整理各SNS平台的错误码所对应的英文和中文描述,可自己扩展,方便在应用中错误提示,也可以当做手册查询
#install
npm install snserror
#useage
1.直接使用:获取到错误的code之后,直接查询:
```
var code = 1110;
var snserror = require("snserror");
console.log(snserror.sina[code].cn);//输出1110对应的中文释义
```
2.应用自定制```
var _ = require("underscore");
var snserror = require("snserror");
snserror.sina = _.extend(snserror.sina, {
"1110":{
cn:"我自己定制我的错误信息"
}
});
console.log(snserror.sina[1110].cn);//输出1110对应的中文释义
```