review-comments: refactor getActionsStatus to accept an extra parameter designating if the analysis is third-party
This commit is contained in:
parent
01f1a1f2c9
commit
55ee663d5f
30 changed files with 121 additions and 56 deletions
|
|
@ -150,13 +150,15 @@ test("wrapApiConfigurationError correctly wraps specific configuration errors",
|
|||
new util.ConfigurationError("API rate limit exceeded for installation"),
|
||||
);
|
||||
|
||||
const tokenSuggestionMessage =
|
||||
"Please check that your token is valid and has the required permissions: contents: read, security-events: write";
|
||||
const badCredentialsError = new util.HTTPError("Bad credentials", 401);
|
||||
res = api.wrapApiConfigurationError(badCredentialsError);
|
||||
t.deepEqual(res, new util.ConfigurationError("Bad credentials"));
|
||||
t.deepEqual(res, new util.ConfigurationError(tokenSuggestionMessage));
|
||||
|
||||
const notFoundError = new util.HTTPError("Not Found", 404);
|
||||
res = api.wrapApiConfigurationError(notFoundError);
|
||||
t.deepEqual(res, new util.ConfigurationError("Not Found"));
|
||||
t.deepEqual(res, new util.ConfigurationError(tokenSuggestionMessage));
|
||||
|
||||
const resourceNotAccessibleError = new util.HTTPError(
|
||||
"Resource not accessible by integration",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue