Switch to TypeError.

This commit is contained in:
Itamar Turner-Trauring 2022-03-18 10:12:51 -04:00
parent fae9556e3d
commit 7de3d93b0e

View File

@ -123,7 +123,11 @@ class StorageClient(object):
# If there's a request message, serialize it and set the Content-Type
# header:
if message_to_serialize is not None:
assert "data" not in kwargs
if "data" in kwargs:
raise TypeError(
"Can't use both `message_to_serialize` and `data` "
"as keyword arguments at the same time"
)
kwargs["data"] = dumps(message_to_serialize)
headers.addRawHeader("Content-Type", CBOR_MIME_TYPE)