semvec/pypi-packages huggingface dataset:
ym-error-code 0.0.4
YIMIAN common error code definition
License: MIT

# Project description

YiMian common error code definition.  
This module provides a general error code definition,
and all projects can inherit this general class to realize
the maintenance of general error codes in different projects.

# Quick start:
```
pip install ym-error-code 
```
```python
class MyErrorCode(CommonErrorCode):
    """My project error code definition.

    Default language is English.
    """
    def __init__(self):
        super().__init__(product_code='09', lang='zh')
        self.ErrorCodeDefinition.REASON_EN.update(self.REASON_EN)
        self.ErrorCodeDefinition.REASON_EN.update(self.REASON_ZH)
        self.ErrorCodeDefinition.MY_ERROR = 'B5000'

    REASON_EN = {
        'B5000': 'My server error'
    }

    REASON_ZH = {

    }

err = MyErrorCode()
print("code: {} reason: {}".format(err.ACCOUNT_IS_LOCKED, err.get_reason(err.ACCOUNT_IS_LOCKED)))
print("code: {} reason: {}".format(err.MY_ERROR, err.get_reason(err.MY_ERROR)))
```
Please refer to demo.py for more information of quick start.