mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 01:32:34 -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) => {
|
||||
if (!callback) { return; }
|
||||
if (this.isSuccess(response)) {
|
||||
callback(undefined, response);
|
||||
} else if (error || this.isError(response)) {
|
||||
|
||||
if (error || this.isError(response)) {
|
||||
let hdfsError = this.parseError(response, body, error);
|
||||
callback(hdfsError, response);
|
||||
} else if (this.isSuccess(response)) {
|
||||
callback(undefined, response);
|
||||
} else {
|
||||
let hdfsError = new HdfsError(
|
||||
localize('webhdfs.unexpectedRedirect', 'Unexpected Redirect'),
|
||||
|
||||
Reference in New Issue
Block a user