Displaying 2 results from an estimated 2 matches for "unexpected_response".
2018 Jun 05
2
[PATCH] v2v: Log full imageio response on failure.
...+228,29 @@ def can_flush(h):
def get_size(h):
return params['disk_size']
+# Any unexpected HTTP response status from the server will end up
+# calling this function which logs the full error, pauses the
+# transfer, sets the failed state, and raises a RuntimeError
+# exception.
+def unexpected_response(h, r, msg):
+ # Setting the failed flag in the handle causes the disk to be
+ # cleaned up on close.
+ h['failed'] = True
+ h['transfer_service'].pause()
+
+ status = r.status
+ reason = r.reason
+ body = r.read()
+
+ # Log the full error if we're verbose...
2018 Jun 05
0
Re: [PATCH] v2v: Log full imageio response on failure.
...get_size(h):
> return params['disk_size']
>
> +# Any unexpected HTTP response status from the server will end up
> +# calling this function which logs the full error, pauses the
> +# transfer, sets the failed state, and raises a RuntimeError
> +# exception.
> +def unexpected_response(h, r, msg):
>
This is not really unexpected response, maybe "request_failed"?
> + # Setting the failed flag in the handle causes the disk to be
> + # cleaned up on close.
> + h['failed'] = True
> + h['transfer_service'].pause()
> +
> +...