Skip to content

Commit

Permalink
fix: updated error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jbristowe committed Sep 14, 2021
1 parent 1e9d5ce commit 3a1aa24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/create-release.ts
Expand Up @@ -136,7 +136,9 @@ export async function createRelease(

try {
await exec('octo', args, options)
} catch (err) {
setFailed(err)
} catch (e: unknown) {
if (e instanceof Error) {
setFailed(e)
}
}
}
6 changes: 4 additions & 2 deletions src/index.ts
Expand Up @@ -6,8 +6,10 @@ async function run(): Promise<void> {
try {
const inputParameters = get()
await createRelease(inputParameters)
} catch (error) {
setFailed(error.message)
} catch (e: unknown) {
if (e instanceof Error) {
setFailed(e)
}
}
}

Expand Down

0 comments on commit 3a1aa24

Please sign in to comment.