4.0.0 • Published 8 years ago

response_engine v4.0.0

Weekly downloads
2
License
ISC
Repository
-
Last release
8 years ago

Installation

package.json

{
    "dependencies": {
        "error_engine":"*"
    }
}

$ npm install

Configuration

## edit your error_dictionary file to add your errors, list all of your errors 
in assa array,keep the code is the key will be use to search for an error 
in the array
```js
{
    "errors": [        
        {
            "code": "1500",
            "developer_message": "we have some technical difficulties at this moment. sorry for the inconvenience",
            "more_details":"no more details you should know about",
            "user_message": [
                {
                    "lanagauge_code": 1,
                    "lanagauge_name": "Arabic",
                    "message": "لدينا بعض الصعوبات التقنية في هذه اللحظة . نأسف للإزعاج"

                },
                {
                    "lanagauge_code": 2,
                    "lanagauge_name": "English",
                    "message": "we have some technical difficulties at this moment. sorry for the inconvenience"
                }
            ]
        }
    ]
}

use it

var error_engine = require('error_engine');
error_engine.get_error_by_code("KMS_0008", "");