@sap-ux/axios-extension
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -60,8 +60,10 @@ import type { Logger } from '@sap-ux/logger'; | ||
* @param options.host optional host name to pretty print links | ||
* @param options.isDest optional value if additional info should be printed | ||
* @param showAllMessages optional, show all errors but restrict for certain flows i.e. test mode | ||
*/ | ||
export declare function prettyPrintError({ error, log, host }: { | ||
export declare function prettyPrintError({ error, log, host, isDest }: { | ||
error: ErrorMessage; | ||
log: Logger; | ||
host?: string; | ||
isDest?: boolean; | ||
}, showAllMessages?: boolean): void; | ||
@@ -68,0 +70,0 @@ /** |
@@ -82,5 +82,6 @@ "use strict"; | ||
* @param options.host optional host name to pretty print links | ||
* @param options.isDest optional value if additional info should be printed | ||
* @param showAllMessages optional, show all errors but restrict for certain flows i.e. test mode | ||
*/ | ||
function prettyPrintError({ error, log, host }, showAllMessages = true) { | ||
function prettyPrintError({ error, log, host, isDest }, showAllMessages = true) { | ||
var _a, _b, _c; | ||
@@ -95,3 +96,3 @@ if (error) { | ||
} | ||
logFullURL({ host, path: entry['longtext_url'], log }); | ||
logFullURL({ host, path: entry['longtext_url'], log, isDest }); | ||
}); | ||
@@ -98,0 +99,0 @@ if (showAllMessages && ((_c = error.innererror) === null || _c === void 0 ? void 0 : _c.Error_Resolution)) { |
@@ -157,6 +157,8 @@ /// <reference types="node" /> | ||
* @param e.host hostname | ||
* @param e.isDest | ||
*/ | ||
protected logError({ error, host }: { | ||
protected logError({ error, host, isDest }: { | ||
error: Error; | ||
host?: string; | ||
isDest?: boolean; | ||
}): void; | ||
@@ -163,0 +165,0 @@ /** |
@@ -96,2 +96,3 @@ "use strict"; | ||
const frontendUrl = this.getAbapFrontendUrl(); | ||
const isDest = /\.dest\//.test(config.baseURL); | ||
try { | ||
@@ -105,3 +106,3 @@ const response = yield this.updateRepoRequest(!!info, bsp.name, payload, config); | ||
host: frontendUrl, | ||
isDest: /\.dest\//.test(config.baseURL) | ||
isDest | ||
}); | ||
@@ -122,3 +123,4 @@ } | ||
log: this.log, | ||
host: frontendUrl | ||
host: frontendUrl, | ||
isDest | ||
}, false); | ||
@@ -129,3 +131,3 @@ } | ||
catch (error) { | ||
this.logError({ error, host: frontendUrl }); | ||
this.logError({ error, host: frontendUrl, isDest }); | ||
throw error; | ||
@@ -149,2 +151,3 @@ } | ||
const info = yield this.getInfo(bsp.name); | ||
const isDest = /\.dest\//.test(config.baseURL); | ||
try { | ||
@@ -154,3 +157,8 @@ if (info) { | ||
if ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a['sap-message']) { | ||
(0, message_1.prettyPrintMessage)({ msg: response.headers['sap-message'], log: this.log, host }); | ||
(0, message_1.prettyPrintMessage)({ | ||
msg: response.headers['sap-message'], | ||
log: this.log, | ||
host, | ||
isDest | ||
}); | ||
} | ||
@@ -165,3 +173,3 @@ return response; | ||
catch (error) { | ||
this.logError({ error, host }); | ||
this.logError({ error, host, isDest }); | ||
throw error; | ||
@@ -340,4 +348,5 @@ } | ||
* @param e.host hostname | ||
* @param e.isDest | ||
*/ | ||
logError({ error, host }) { | ||
logError({ error, host, isDest }) { | ||
var _a, _b; | ||
@@ -348,3 +357,3 @@ this.log.error(error.message); | ||
if (errorMessage) { | ||
(0, message_1.prettyPrintError)({ error: errorMessage, host, log: this.log }); | ||
(0, message_1.prettyPrintError)({ error: errorMessage, host, log: this.log, isDest }); | ||
} | ||
@@ -351,0 +360,0 @@ else { |
{ | ||
"name": "@sap-ux/axios-extension", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Extension of the Axios module adding convenience methods to interact with SAP systems especially with OData services.", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
236738
5339