Treating exceptions on beforeEach, afterEach, beforeAll and afterAll

Relates to #361