Catch exceptions in before class

NOT FOR MERGE, ONLY REVIEW NOW
=====

#187 - first part of task