Creating a global error handlerΒΆ