Commit aeecad2
committed
cloud_storage_clients: skip lexical_cast on empty strings
`parse_rest_error_response` method tries to read fields from xml response
and constructs `rest_error_response`. If a field is not found or is
empty then it defaults to empty string.
https://github.com/redpanda-data/redpanda/blob/d3c2f00c4071c2cbce1e1babdfc2291e3c9898ba/src/v/cloud_storage_clients/s3_client.cc#L411
Google Cloud Storage gives one of these replies which we parse but the
Error.Code path is not present in the response and we trip with a bad
lexical cast which results in an error log line.
With this commit we'll default to unknown error code in that case. We
already do the same for codes we don't recognize in the operator>>.
lexical_cast does not call the operator>> at all for empty strings.1 parent 90c713a commit aeecad2
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
424 | 426 | | |
425 | 427 | | |
426 | 428 | | |
| |||
0 commit comments