Errors in a task are converted to RuntimeError

The reason for this small change is that a generic exception class can display the error message doing something different than str(error_msg). In particular the KeyError exception, which is quite common, performs a repr(error_msg). That means that for that exception the traceback, which is contained in the error_msg, is displayed in a horrible and unreadable format, which is quite frustrating when debugging. The RuntimeError instead it is well behaved: no escaping of newlines and such. The name of the original exception is still inside the traceback and it can be extracted from there for stringent tests on expected exceptions.