You should be able to try/catch
the pipeline.
use Illuminate\Support\Facades\Pipeline;
try{
$data = Pipeline::send($whatever)
->through([
TaskOne::class,
TaskTwo::class
])
->thenReturn();
}catch(MyException $e){
// Handle however you want
}