Coverage for / home / casatest / venv / lib / python3.12 / site-packages / casatools / errors.py: 84%
19 statements
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-12 07:14 +0000
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-12 07:14 +0000
2def create_error_string( errors ):
3 variable = None
4 value = None
5 vec = False
6 if type(errors) == dict:
7 for k,v in errors.items():
8 if type(v) == list:
9 if v[0] == 'path not found':
10 value = k
11 if v[0] == 'path vector element not found':
12 value = k
13 vec = True
14 if v[0] == 'must be of cReqPath type':
15 variable = k
17 if value is not None:
18 if variable is not None:
19 return ( "all elements of the %s vector parameter must be a path that exists (at least one element of \"%s\" does not exist)"
20 if vec else "the %s parameter must be a path that exists ('%s' does not exist)" ) % (variable, value)
21 else:
22 return ( "all elements of the vector parameter must be a path that exists (at least one element of \"%s\" does not exist)"
23 if vec else "the path parameter must contain a path that exists ('%s' does not exist)" ) % value
24 else:
25 return str(errors)