oci-common
Advanced tools
Comparing version
@@ -94,4 +94,9 @@ "use strict"; | ||
getPvtKey(filePath) { | ||
const key = fs_1.readFileSync(filePath, "utf8"); | ||
return key; | ||
try { | ||
const key = fs_1.readFileSync(filePath, "utf8"); | ||
return key; | ||
} | ||
catch (e) { | ||
throw "Failed to read private key from file path."; | ||
} | ||
} | ||
@@ -98,0 +103,0 @@ /** |
@@ -39,6 +39,10 @@ "use strict"; | ||
else if (typeof body == "string" && body.length > 0) { | ||
return new error_1.OciError(statusCode, "unknown code", body, requestId); | ||
return new error_1.OciError(statusCode, "None", body, requestId); | ||
} | ||
else if (response.statusText && response.statusText.length > 0) { | ||
// There is no body text but statusText exists | ||
return new error_1.OciError(statusCode, "None", response.statusText, requestId); | ||
} | ||
else { | ||
return new error_1.OciError(statusCode, "unknown code", "unknown reason.", requestId); | ||
return new error_1.OciError(statusCode, "None", "unknown reason.", requestId); | ||
} | ||
@@ -55,3 +59,3 @@ } | ||
catch (err) { | ||
console.log("Cannot parse data into JSON"); | ||
return data; | ||
} | ||
@@ -58,0 +62,0 @@ return data; |
{ | ||
"name": "oci-common", | ||
"version": "1.19.4", | ||
"version": "1.19.5", | ||
"description": "OCI Common module for NodeJS", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
430167
0.12%5222
0.17%