@@ -320,11 +320,11 @@ class CompressionStreamBase: public kj::Refcounted,
320320 auto pending = kj::mv (pendingReads.front ());
321321 pendingReads.pop_front ();
322322 if (pending.promise ->isWaiting ()) {
323- pending.promise ->reject (kj::cp ( reason));
323+ pending.promise ->reject (reason. clone ( ));
324324 }
325325 }
326326
327- canceler.cancel (kj::cp ( reason));
327+ canceler.cancel (reason. clone ( ));
328328 transitionToErrored (kj::mv (reason));
329329 }
330330
@@ -374,7 +374,7 @@ class CompressionStreamBase: public kj::Refcounted,
374374 KJ_IF_SOME (exception, kj::runCatchingExceptions ([this , flush, &result]() {
375375 result = context.pumpOnce (flush);
376376 })) {
377- cancelInternal (kj::cp ( exception));
377+ cancelInternal (exception. clone ( ));
378378 kj::throwFatalException (kj::mv (exception));
379379 }
380380
@@ -412,12 +412,12 @@ class CompressionStreamBase: public kj::Refcounted,
412412 // so we need to report an error here and error the stream.
413413 if (pending.filled > 0 ) {
414414 auto ex = JSG_KJ_EXCEPTION (FAILED, Error, " A partially fulfilled read was canceled." );
415- cancelInternal (kj::cp (ex ));
415+ cancelInternal (ex. clone ( ));
416416 kj::throwFatalException (kj::mv (ex));
417417 }
418418
419419 auto ex = JSG_KJ_EXCEPTION (FAILED, Error, " The pending read was canceled." );
420- cancelInternal (kj::cp (ex ));
420+ cancelInternal (ex. clone ( ));
421421 kj::throwFatalException (kj::mv (ex));
422422 }
423423
@@ -478,7 +478,7 @@ class CompressionStreamImpl final: public CompressionStreamBase<mode> {
478478 protected:
479479 void requireActive (kj::StringPtr errorMessage) override {
480480 KJ_IF_SOME (exception, state.tryGetErrorUnsafe ()) {
481- kj::throwFatalException (kj::cp ( exception));
481+ kj::throwFatalException (exception. clone ( ));
482482 }
483483 // isActive() returns true only if in Open state (the ActiveState)
484484 JSG_REQUIRE (state.isActive (), Error, errorMessage);
@@ -500,7 +500,7 @@ class CompressionStreamImpl final: public CompressionStreamBase<mode> {
500500
501501 void throwIfException () override {
502502 KJ_IF_SOME (exception, state.tryGetErrorUnsafe ()) {
503- kj::throwFatalException (kj::cp ( exception));
503+ kj::throwFatalException (exception. clone ( ));
504504 }
505505 }
506506
0 commit comments