Merge pull request #653 from peter-evans/fix-error-handling

fix: change or->and to catch all errors
This commit is contained in:
Peter Evans 2020-12-09 09:56:23 +09:00 committed by GitHub
commit 8c603dbb04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

7
dist/index.js vendored
View file

@ -911,8 +911,11 @@ class GitHubHelper {
}; };
} }
catch (e) { catch (e) {
if (!e.message || if (e.message &&
!e.message.includes(`A pull request already exists for ${headBranch}`)) { e.message.includes(`A pull request already exists for ${headBranch}`)) {
core.info(`A pull request already exists for ${headBranch}`);
}
else {
throw e; throw e;
} }
} }

View file

@ -58,9 +58,11 @@ export class GitHubHelper {
} }
} catch (e) { } catch (e) {
if ( if (
!e.message || e.message &&
!e.message.includes(`A pull request already exists for ${headBranch}`) e.message.includes(`A pull request already exists for ${headBranch}`)
) { ) {
core.info(`A pull request already exists for ${headBranch}`)
} else {
throw e throw e
} }
} }