Make "ApiError" the default error code for ApiError instances, rather than "Unknown."
Make "ApiError" the default error code for ApiError instances, rather than "Unknown."

Note Dashoard's error handling code:

        except boto.exception.BotoServerError, e:
            if e.status == 400 and e.error_code == 'ApiError':
                raise NovaApiError(e)
            elif e.status == 401:
                raise NovaUnauthorizedError()
            elif e.status == 503:
                raise NovaUnavailableError(e)
            raise NovaServerError(e)

So an error_code of 'Unknown' will raise an ugly exception.

This change also makes the euca errors a bit prettier:

> euca-attach-volume -i i-1 vol-2 -d /dev/vdb
> ApiError: ApiError: Volume status must be available


Rather than:

> euca-attach-volume -i i-1 vol-2 -d /dev/vdb
> Unknown: Unknown: Volume status must be available

Though the reiteration of the error code is still a bit ugly.

citrix-openstack-build/oslo.versionedobjects,openstack/oslo.versionedobjects