Skip to content

Commit

Permalink
Catch and fail GPUPipelineError
Browse files Browse the repository at this point in the history
Co-authored-by: Brandon Jones <[email protected]>
Signed-off-by: sagudev <[email protected]>
  • Loading branch information
sagudev committed Jul 17, 2024
1 parent 20425f6 commit a4016ff
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 a4016ff

Please sign in to comment.