(err, log_details)
The less unexpected way for plugins to fail.

    A helper function that logs the given exception
    and then raises an exception.  Stolos will see this error, mark the
    job as failed and quit.  Plugin exceptions not handled by this function
    will cause Stolos to complain that you have unexpected errors in your
    plugin code.
The less unexpected way for plugins to fail.
The less unexpected way for plugins to fail .
def log_and_raise(err, log_details):
    """The less unexpected way for plugins to fail.

    A helper function that logs the given exception
    and then raises an exception.  Stolos will see this error, mark the
    job as failed and quit.  Plugin exceptions not handled by this function
    will cause Stolos to complain that you have unexpected errors in your
    plugin code.
    """
    log.exception(err, extra=log_details)
    raise _CodeError(
        'Task failed. This particular error message will never appear in logs.'
    )
def log_and_raise ( err , log_details ) : log . exception ( err , extra = log_details ) raise _CodeError ( 'Task failed. This particular error message will never appear in logs.' )