github.com/jfrog/frogbot@v1.1.1-0.20231221090046-821a26f50338/action/node_modules/@octokit/graphql/dist-src/error.js (about)

     1  function _buildMessageForResponseErrors(data) {
     2      return (`Request failed due to following response errors:\n` +
     3          data.errors.map((e) => ` - ${e.message}`).join("\n"));
     4  }
     5  export class GraphqlResponseError extends Error {
     6      constructor(request, headers, response) {
     7          super(_buildMessageForResponseErrors(response));
     8          this.request = request;
     9          this.headers = headers;
    10          this.response = response;
    11          this.name = "GraphqlResponseError";
    12          // Expose the errors and response data in their shorthand properties.
    13          this.errors = response.errors;
    14          this.data = response.data;
    15          // Maintains proper stack trace (only available on V8)
    16          /* istanbul ignore next */
    17          if (Error.captureStackTrace) {
    18              Error.captureStackTrace(this, this.constructor);
    19          }
    20      }
    21  }