Print error stacktrace if operation fails with an instance of Error