@@ -136,8 +136,8 @@ file_io::put_object(object_id oid, staging_file* file, ss::abort_source* as) {
136136 " l1_file_upload" ,
137137 std::nullopt ));
138138 if (result_fut.failed ()) {
139- vlog (
140- cd_log.warn , " Error uploading file: {}" , result_fut. get_exception () );
139+ auto ex = result_fut. get_exception ();
140+ vlog ( cd_log.warn , " Error uploading file: {}" , ex );
141141 co_return std::unexpected (io::errc::cloud_op_error);
142142 }
143143 switch (result_fut.get ()) {
@@ -187,11 +187,9 @@ file_io::read_object(object_extent extent, ss::abort_source* as) {
187187 std::optional<cloud_io::cache_item_stream>>(
188188 _cache->get_stream (cache_key));
189189 if (stream_fut.failed ()) {
190+ auto ex = stream_fut.get_exception ();
190191 vlog (
191- cd_log.warn ,
192- " Error reading from cache for {}: {}" ,
193- extent,
194- stream_fut.get_exception ());
192+ cd_log.warn , " Error reading from cache for {}: {}" , extent, ex);
195193 co_return std::unexpected (io::errc::file_io_error);
196194 }
197195 auto stream = stream_fut.get ();
@@ -203,11 +201,12 @@ file_io::read_object(object_extent extent, ss::abort_source* as) {
203201 cloud_io::space_reservation_guard>(
204202 _cache->reserve_space (extent.size , 1 ));
205203 if (reservation_fut.failed ()) {
204+ auto ex = reservation_fut.get_exception ();
206205 vlog (
207206 cd_log.warn ,
208207 " Error reserving cache space for download of {}: {}" ,
209208 extent,
210- reservation_fut. get_exception () );
209+ ex );
211210 co_return std::unexpected (io::errc::file_io_error);
212211 }
213212 cloud_io::try_consume_stream consumer =
@@ -230,11 +229,8 @@ file_io::read_object(object_extent extent, ss::abort_source* as) {
230229 cloud_storage_clients::http_byte_range{
231230 extent.position , extent.position + extent.size - 1 }));
232231 if (result_fut.failed ()) {
233- vlog (
234- cd_log.warn ,
235- " Error downloading object {}: {}" ,
236- extent,
237- result_fut.get_exception ());
232+ auto ex = result_fut.get_exception ();
233+ vlog (cd_log.warn , " Error downloading object {}: {}" , extent, ex);
238234 co_return std::unexpected (io::errc::cloud_op_error);
239235 }
240236 switch (result_fut.get ()) {
@@ -267,10 +263,8 @@ file_io::delete_objects(chunked_vector<object_id> ids, ss::abort_source* as) {
267263 std::ignore = retry_count;
268264 }));
269265 if (result_fut.failed ()) {
270- vlog (
271- cd_log.warn ,
272- " Error deleting objects: {}" ,
273- result_fut.get_exception ());
266+ auto ex = result_fut.get_exception ();
267+ vlog (cd_log.warn , " Error deleting objects: {}" , ex);
274268 co_return std::unexpected (io::errc::cloud_op_error);
275269 }
276270 switch (result_fut.get ()) {
0 commit comments