mfesiem / msiempy

McAfee SIEM API Python wrapper
https://mfesiem.github.io/docs/msiempy/msiempy.html
MIT License
23 stars 9 forks source link

Better error handling #22

Closed tristanlatr closed 4 years ago

tristanlatr commented 5 years ago

NitroSession should handle correctly SIEM errors :

Currently, calls to NitroSession.esm_request that raises requests.HTTPError errors can raise NitroError if the error is unhandled.
See docs : https://mfesiem.github.io/docs/msiempy/index.html#msiempy.NitroSession.esm_request

tristanlatr commented 4 years ago

I've tried to implement an invalid session error handler. It re-logins the user, then it sleeps 0.2s and retry the request. If it still run into an error, It returns a NitroError

tristanlatr commented 4 years ago

The method NitroSession.esm_request currently handles the following errors :

tristanlatr commented 4 years ago

The current behaviour for NitroSession.esm_request() is to automatically retry once the request if it failed. If it's a login issue it will re-login first.

The current behaviour for EventManager.qry_load_data() is the same: retry once the request