saltstack/salt — pull request #9091 by SmithSamuelM (2013-12-06 22:26:13+00:00)
Title: Fix exception handling on runner and wheel api clients

Improve the exception handling for the runner and wheel client api.
With the new return semantics when an exception occurs the dict returned now includes an error field
the value of this field is a dict with the keys

name= exception class name
args= exception args
message= exception message

This enables the api to reraise the exception on the api side of the master_call for runner and wheel functions

Improved the error classifiction so eauth and token errors are distinct.
Also exceptions will now be reported more accurately, all exceptions are not eauth exceptions.

A utility function was added in salt/utils/error called raise_error that raises the exception specified by
the new error field in the return.
This function that s for exception classes with the name first in salt.exceptions and then exceptions
Other runners that wish to have their exception correctley reraised should add an if clause to this function
Or refactor to have a list that is imported and checked