Common module to create error response object at server side
- Sequelize error code series starts from 1001
- Cassandra error code series starts from 2001
- Unknown error code series starts from 3001
- Business logic error code series starts from 5001
- Internal error code series starts from 7001
{
"code": "SS-200",
"message": "Success",
"data": [
{
"id": "204adf30-f444-11e6-bf17-574185f61676",
"account": 1,
"ticket_id": null,
"timestamp": "1486665020",
"sensor_uuid": "1234",
"ecgdata_status": null,
"ticket_number": null,
"patient_id": null
}
]
}
{
"code": "US-1002",
"message": "Sequelize validation failed",
"error": {
"name": "SequelizeValidationError",
"message": "notNull Violation: first_name cannot be null",
"errors": [
{
"message": "first_name cannot be null",
"type": "notNull Violation",
"path": "first_name",
"value": null
}
]
}
}
npm login
npm publish
npm version [patch/minor/major]
npm publish
npm publish --update-readme
npm update --save