File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import { openConfigFile } from "../utils/workspaceUtils";
34
34
import { CICSPlexTree } from "./CICSPlexTree" ;
35
35
import { CICSRegionTree } from "./CICSRegionTree" ;
36
36
import { CICSSessionTree } from "./CICSSessionTree" ;
37
+ import { getErrorCode } from "../utils/errorUtils" ;
37
38
38
39
export class CICSTree implements TreeDataProvider < CICSSessionTree > {
39
40
loadedProfiles : CICSSessionTree [ ] = [ ] ;
@@ -236,14 +237,8 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
236
237
plexInfo = await ProfileManagement . getPlexInfo ( profile , sessionTree . getSession ( ) ) ;
237
238
break ;
238
239
} catch ( error ) {
239
- if (
240
- retry === 0 &&
241
- (
242
- error ?. mDetails ?. errorCode === constants . HTTP_ERROR_UNAUTHORIZED ||
243
- error ?. response ?. status == constants . HTTP_ERROR_UNAUTHORIZED
244
- )
245
- ) {
246
- retry = retry + 1 ;
240
+ if ( retry === 0 && getErrorCode ( error ) === constants . HTTP_ERROR_UNAUTHORIZED ) {
241
+ retry ++ ;
247
242
const newProfile = await updateProfile ( profile , sessionTree ) ;
248
243
249
244
if ( ! newProfile ) {
Original file line number Diff line number Diff line change
1
+ /**
2
+ * This program and the accompanying materials are made available under the terms of the
3
+ * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4
+ * https://www.eclipse.org/legal/epl-v20.html
5
+ *
6
+ * SPDX-License-Identifier: EPL-2.0
7
+ *
8
+ * Copyright Contributors to the Zowe Project.
9
+ *
10
+ */
11
+
12
+ export function getErrorCode ( error : any ) {
13
+ return error . mDetails ?. errorCode || error . response ?. status ;
14
+ }
You can’t perform that action at this time.
0 commit comments