[BUGFIX] Fix scheduler task logging in case of an exception