diff options
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | api.py | 6 |
2 files changed, 13 insertions, 2 deletions
@@ -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 | @@ -35,7 +35,11 @@ class EjabberdApi: status = self.cmd('status', {}) # matches - tmp = ver_str.findall(status)[0] + try: + 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 version.parse(tmp) |