mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 01:30:10 +08:00
I explicitly had to downgrade "@octokit/plugin-retry" to "^6.0.0". Other dependencies were upgraded.
22 lines
636 B
JavaScript
22 lines
636 B
JavaScript
function _buildMessageForResponseErrors(data) {
|
|
return `Request failed due to following response errors:
|
|
` + data.errors.map((e) => ` - ${e.message}`).join("\n");
|
|
}
|
|
class GraphqlResponseError extends Error {
|
|
constructor(request, headers, response) {
|
|
super(_buildMessageForResponseErrors(response));
|
|
this.request = request;
|
|
this.headers = headers;
|
|
this.response = response;
|
|
this.name = "GraphqlResponseError";
|
|
this.errors = response.errors;
|
|
this.data = response.data;
|
|
if (Error.captureStackTrace) {
|
|
Error.captureStackTrace(this, this.constructor);
|
|
}
|
|
}
|
|
}
|
|
export {
|
|
GraphqlResponseError
|
|
};
|