Archived
Check error in webhdfs.sendRequest before trying to check response code. (#4561)
This commit is contained in:
committed by
Karl Burtram
parent
16dbef978e
commit
5e02486ace
@@ -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