Skip to content

Get response status even on "error" #386

Closed Answered by joshft91
joshft91 asked this question in Q&A
Discussion options

You must be logged in to vote

I was messing around with this more and found this as a potential workaround/solution by catching thrown error and returning the response object. Is there a better/cleaner way?

const response = await github.request('GET /repos/{owner}/{repo}/actions/variables/{name}', {
    owner: context.repo.owner,
    repo: context.repo.repo,
    name
  }).catch(response => response)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by joshft91
Comment options

You must be logged in to vote
1 reply
@joshft91
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants