fix version string being unpopulated
* fix version string being empty + add error code 17 to the README resolves #2 Error Code 17 means one of two things a) the configured user credentials are not correct, therefore the user is not able to properly login b) the configured user does not have the correct permissions to interact with the api
This commit is contained in:
parent
0e0f9565c2
commit
5cf6889799
|
@ -1,2 +1,9 @@
|
||||||
# ejabberd-metrics
|
## ejabberd-tools
|
||||||
|
|
||||||
|
### error codes
|
||||||
|
Lookup table for all custom error codes.
|
||||||
|
The potential reasons are sorted by probability of being the root cause.
|
||||||
|
|
||||||
|
| code | potential reason |
|
||||||
|
| :---: | :---|
|
||||||
|
| 17 | login credential mismatch, potential api permission problem |
|
||||||
|
|
4
api.py
4
api.py
|
@ -35,7 +35,11 @@ class EjabberdApi:
|
||||||
status = self.cmd('status', {})
|
status = self.cmd('status', {})
|
||||||
|
|
||||||
# matches
|
# matches
|
||||||
|
try:
|
||||||
tmp = ver_str.findall(status)[0]
|
tmp = ver_str.findall(status)[0]
|
||||||
|
# raise SystemExit code 17 if no status message is received
|
||||||
|
except TypeError:
|
||||||
|
raise SystemExit(17)
|
||||||
|
|
||||||
# return parsed version string
|
# return parsed version string
|
||||||
return version.parse(tmp)
|
return version.parse(tmp)
|
||||||
|
|
Loading…
Reference in New Issue