From 0557f9f1e444cacdf0572a5b1a0e51f01773fb42 Mon Sep 17 00:00:00 2001 From: daz Date: Sat, 23 Dec 2023 18:52:39 -0700 Subject: [PATCH] Error handling --- src/dependency-graph.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/dependency-graph.ts b/src/dependency-graph.ts index dae9c746..ced37cf0 100644 --- a/src/dependency-graph.ts +++ b/src/dependency-graph.ts @@ -39,16 +39,20 @@ export async function setup(option: DependencyGraphOption): Promise { } export async function complete(option: DependencyGraphOption): Promise { - switch (option) { - case DependencyGraphOption.Disabled: - case DependencyGraphOption.DownloadAndSubmit: // Performed in setup - return - case DependencyGraphOption.Generate: - await uploadDependencyGraphs() - return - case DependencyGraphOption.GenerateAndSubmit: - await submitDependencyGraphs(await uploadDependencyGraphs()) - return + try { + switch (option) { + case DependencyGraphOption.Disabled: + case DependencyGraphOption.DownloadAndSubmit: // Performed in setup + return + case DependencyGraphOption.Generate: + await uploadDependencyGraphs() + return + case DependencyGraphOption.GenerateAndSubmit: + await submitDependencyGraphs(await uploadDependencyGraphs()) + return + } + } catch (e) { + core.warning(`Process dependency graph failed. Will continue. ${String(e)}`) } }