Skip to content

Commit

Permalink
Catch and fail GPUPipelineError (#3866)
Browse files Browse the repository at this point in the history
Signed-off-by: sagudev <[email protected]>
Co-authored-by: Brandon Jones <[email protected]>
  • Loading branch information
sagudev and toji authored Jul 18, 2024
1 parent 428adb4 commit fb57fd8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/webgpu/shader/execution/expression/expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,17 @@ export async function run(
}
batchesInFlight += 1;

pendingBatches.push(processBatch(batchCases).finally(batchFinishedCallback));
pendingBatches.push(
processBatch(batchCases)
.catch(err => {
if (err instanceof GPUPipelineError) {
t.fail(`Pipeline Creation Error, ${err.reason}: ${err.message}`);
} else {
throw err;
}
})
.finally(batchFinishedCallback)
);
}

await Promise.all(pendingBatches);
Expand Down

0 comments on commit fb57fd8

Please sign in to comment.