Reduction of escalus crashes when things go wrong & Timeout parameter accepted
See commit messages for changes
Justification: As soon as target systems started timing out, or didn't exist we were generating error logs with hundreds of thousands of entries due to having a few thousand concurrent escalus connections running. We instead wanted to record these issues using the onX functions passed as parameters. Have tried to change so all failures in setting up the connection are caught under the connection step and returned with the connection step failing. Inside the clients themselves tried to minimize the chance of mostly badmatches happening, reporting what we can back to the owner. Will freely admit some of the decisions are a bit hacky and not very nice but open to ideas on a better way to do this. We just needed to avoid crashes as much as possible in normal operation (which involves things not going to plan!).
Timeout is self explanatory and should have 0 functional changes if ignored.
Could you create an empty PR for MongooseIM and ejabberd_tests using your escalus branch? Here is some doc regarding test branch discovery.
Old PR, closing