mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 20:51:42 +00:00
build
This commit is contained in:
12
node_modules/@octokit/graphql/dist-node/index.js
generated
vendored
12
node_modules/@octokit/graphql/dist-node/index.js
generated
vendored
@@ -5,13 +5,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var request = require('@octokit/request');
|
||||
var universalUserAgent = require('universal-user-agent');
|
||||
|
||||
const VERSION = "4.4.0";
|
||||
const VERSION = "4.5.4";
|
||||
|
||||
class GraphqlError extends Error {
|
||||
constructor(request, response) {
|
||||
const message = response.data.errors[0].message;
|
||||
super(message);
|
||||
Object.assign(this, response.data);
|
||||
Object.assign(this, {
|
||||
headers: response.headers
|
||||
});
|
||||
this.name = "GraphqlError";
|
||||
this.request = request; // Maintains proper stack trace (only available on V8)
|
||||
|
||||
@@ -44,7 +47,14 @@ function graphql(request, query, options) {
|
||||
}, {});
|
||||
return request(requestOptions).then(response => {
|
||||
if (response.data.errors) {
|
||||
const headers = {};
|
||||
|
||||
for (const key of Object.keys(response.headers)) {
|
||||
headers[key] = response.headers[key];
|
||||
}
|
||||
|
||||
throw new GraphqlError(requestOptions, {
|
||||
headers,
|
||||
data: response.data
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user