Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support error code for single shot upload #699

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion testbench/rest_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,8 @@ def object_insert(bucket_name):
blob, projection = gcs_type.object.Object.init_media(flask.request, bucket)
elif upload_type == "multipart":
blob, projection = gcs_type.object.Object.init_multipart(flask.request, bucket)

if upload_type == "media" or upload_type == "multipart":
Tulsishah marked this conversation as resolved.
Show resolved Hide resolved
testbench.common.extract_instruction(request, context=None)
Tulsishah marked this conversation as resolved.
Show resolved Hide resolved
(
error_code,
Expand All @@ -989,7 +991,7 @@ def object_insert(bucket_name):
if test_id:
db.dequeue_next_instruction(test_id, "storage.objects.insert")
testbench.error.generic(
"Fault injected during a resumable upload",
"Fault injected during a single-shot upload",
rest_code=error_code,
grpc_code=None,
context=None,
Expand Down