def _convert_mod_error(error): message = error.message.replace( "The condition specified using HTTP conditional header(s) is not met.", "The specified blob already exists.") message = message.replace("ConditionNotMet", "BlobAlreadyExists") overwrite_error = ResourceExistsError(message=message, response=error.response, error=error) overwrite_error.error_code = StorageErrorCode.blob_already_exists raise overwrite_error
def deserialize_queue_creation(response, obj, headers): if response.status_code == 204: error_code = StorageErrorCode.queue_already_exists error = ResourceExistsError( message="Queue already exists\nRequestId:{}\nTime:{}\nErrorCode:{}" .format(headers['x-ms-request-id'], headers['Date'], error_code), response=response) error.error_code = error_code error.additional_info = {} raise error return headers
def _deserialize_table_creation(response, _, headers): if response.status_code == 204: error_code = TableErrorCode.table_already_exists error = ResourceExistsError( message="Table already exists\nRequestId:{}\nTime:{}\nErrorCode:{}" .format(headers["x-ms-request-id"], headers["Date"], error_code), response=response, ) error.error_code = error_code error.additional_info = {} raise error return headers