mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Check error in webhdfs.sendRequest before trying to check response code. (#4561)
This commit is contained in:
@@ -213,11 +213,12 @@ export class WebHDFS {
|
|||||||
|
|
||||||
request(requestParams, (error, response, body) => {
|
request(requestParams, (error, response, body) => {
|
||||||
if (!callback) { return; }
|
if (!callback) { return; }
|
||||||
if (this.isSuccess(response)) {
|
|
||||||
callback(undefined, response);
|
if (error || this.isError(response)) {
|
||||||
} else if (error || this.isError(response)) {
|
|
||||||
let hdfsError = this.parseError(response, body, error);
|
let hdfsError = this.parseError(response, body, error);
|
||||||
callback(hdfsError, response);
|
callback(hdfsError, response);
|
||||||
|
} else if (this.isSuccess(response)) {
|
||||||
|
callback(undefined, response);
|
||||||
} else {
|
} else {
|
||||||
let hdfsError = new HdfsError(
|
let hdfsError = new HdfsError(
|
||||||
localize('webhdfs.unexpectedRedirect', 'Unexpected Redirect'),
|
localize('webhdfs.unexpectedRedirect', 'Unexpected Redirect'),
|
||||||
|
|||||||
Reference in New Issue
Block a user