@octokit/request
Advanced tools
Comparing version 5.1.0 to 5.2.0
@@ -72,3 +72,7 @@ 'use strict'; | ||
try { | ||
Object.assign(error, JSON.parse(error.message)); | ||
let responseBody = JSON.parse(error.message); | ||
Object.assign(error, responseBody); | ||
let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat | ||
error.message = error.message + ": " + errors.map(JSON.stringify).join(", "); | ||
} catch (e) {// ignore, see octokit/rest.js#684 | ||
@@ -75,0 +79,0 @@ } |
@@ -54,3 +54,8 @@ import isPlainObject from "is-plain-object"; | ||
try { | ||
Object.assign(error, JSON.parse(error.message)); | ||
let responseBody = JSON.parse(error.message); | ||
Object.assign(error, responseBody); | ||
let errors = responseBody.errors; | ||
// Assumption `errors` would always be in Array Fotmat | ||
error.message = | ||
error.message + ": " + errors.map(JSON.stringify).join(", "); | ||
} | ||
@@ -57,0 +62,0 @@ catch (e) { |
@@ -62,3 +62,8 @@ import { endpoint } from '@octokit/endpoint'; | ||
try { | ||
Object.assign(error, JSON.parse(error.message)); | ||
let responseBody = JSON.parse(error.message); | ||
Object.assign(error, responseBody); | ||
let errors = responseBody.errors; | ||
// Assumption `errors` would always be in Array Fotmat | ||
error.message = | ||
error.message + ": " + errors.map(JSON.stringify).join(", "); | ||
} | ||
@@ -65,0 +70,0 @@ catch (e) { |
{ | ||
"name": "@octokit/request", | ||
"description": "Send parameterized requests to GitHub’s APIs with sensible defaults in browsers and Node", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"license": "MIT", | ||
@@ -49,3 +49,3 @@ "files": [ | ||
"jest": "^24.7.1", | ||
"lolex": "^4.2.0", | ||
"lolex": "^5.0.0", | ||
"prettier": "^1.17.0", | ||
@@ -52,0 +52,0 @@ "semantic-release": "^15.10.5", |
@@ -26,2 +26,3 @@ # request.js | ||
- [Alternative: pass `method` & `url` as part of options](#alternative-pass-method--url-as-part-of-options) | ||
- [Authentication](#authentication) | ||
- [request()](#request) | ||
@@ -28,0 +29,0 @@ - [`request.defaults()`](#requestdefaults) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
54259
541
540