This repository was archived by the owner on Jun 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patherror_messages.py
42 lines (40 loc) · 1.52 KB
/
error_messages.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
error = {
'not_implemented': {
'err_code': 'not_implemented',
'err_description': 'Method is not implemented',
'err_resolution': 'Check your request.'
},
'not_json': {
'err_code': 'not_json',
'err_description': 'Request contains data in other than JSON format.',
'err_resolution': 'Check your request, or contact the developer.'
},
'no_request_data': {
'err_code': 'no_request_data',
'err_description': 'Request data is empty.',
'err_resolution': 'Check your request, or contact the developer.'
},
'trex_not_start': {
'err_code': 'trex_not_start',
'err_description': 'TRex could not start to generate traffic.',
'err_resolution': 'Check with developer team.'
},
'ascii_error': {
'err_code': 'ascii_error',
'err_description': 'TRex supports ASCII characters only.',
'err_resolution': 'Please verify input data and make sure it contains ASCII-compatible symbols only.'
},
'trex_already_running': {
'err_code': 'trex_already_running',
'err_description': 'TRex is running already.',
'err_resolution': 'Stop traffic, then try to start it again.'
},
'pps_must_be_positive': {
'err_code': 'pps_must_be_positive',
'err_description': 'PPS must have a positive value (>0). Traffic stopped.',
'err_resolution': 'Choose a positive value to start server.'
}
}
# Get an error details by its code
def get_error_message(code):
return error[code]