mirror of
https://github.com/actions/labeler.git
synced 2025-12-16 06:56:51 +00:00
build
This commit is contained in:
8
node_modules/@octokit/graphql/dist-web/index.js
generated
vendored
8
node_modules/@octokit/graphql/dist-web/index.js
generated
vendored
@@ -1,13 +1,14 @@
|
||||
import { request } from '@octokit/request';
|
||||
import { getUserAgent } from '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)
|
||||
@@ -45,7 +46,12 @@ 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