From: Grégoire Aubert Date: Mon, 18 Sep 2017 10:35:01 +0000 (+0200) Subject: SONAR-9834 SQBILLING-52 Reject correctly error response from post request. X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1c18c3a6d670f790f11883308cb5aedb4fabe4fb;p=sonarqube.git SONAR-9834 SQBILLING-52 Reject correctly error response from post request. --- diff --git a/server/sonar-web/src/main/js/helpers/request.ts b/server/sonar-web/src/main/js/helpers/request.ts index 4bac03dadd6..1acb519e000 100644 --- a/server/sonar-web/src/main/js/helpers/request.ts +++ b/server/sonar-web/src/main/js/helpers/request.ts @@ -170,10 +170,10 @@ export function postJSON(url: string, data?: RequestData): Promise { * Shortcut to do a POST request */ export function post(url: string, data?: RequestData): Promise { - return new Promise(resolve => { + return new Promise((resolve, reject) => { request(url).setMethod('POST').setData(data).submit().then(checkStatus).then(() => { resolve(); - }); + }, reject); }); }