File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13487,12 +13487,16 @@ class Github {
1348713487 return envs;
1348813488 }
1348913489 static createGithubConnection(apiToken) {
13490- return axios_1.default.create({
13490+ const config = axios_1.default.create({
1349113491 baseURL: 'https://api.github.com',
1349213492 headers: {
1349313493 Authorization: `Bearer ${apiToken}`,
1349413494 },
1349513495 });
13496+ config.interceptors.response.use(null, ({ response }) => {
13497+ throw new Error(JSON.stringify(response?.data, null, 2));
13498+ });
13499+ return config;
1349613500 }
1349713501}
1349813502exports.Github = Github;
Original file line number Diff line number Diff line change @@ -49,11 +49,16 @@ export class Github {
4949 }
5050
5151 private static createGithubConnection ( apiToken : string ) {
52- return axios . create ( {
52+ const config = axios . create ( {
5353 baseURL : 'https://api.github.com' ,
5454 headers : {
5555 Authorization : `Bearer ${ apiToken } ` ,
5656 } ,
5757 } ) ;
58+ config . interceptors . response . use ( null , ( { response } ) => {
59+ throw new Error ( JSON . stringify ( response ?. data , null , 2 ) ) ;
60+ } ) ;
61+
62+ return config ;
5863 }
5964}
You can’t perform that action at this time.
0 commit comments