diff --git a/build/index.js b/build/index.js index bf7a6aafce966c4ab44ba3abb240578cc68779d6..4678df8734b098f20c7e14d8593bd4328fe759d8 100644 --- a/build/index.js +++ b/build/index.js @@ -266,7 +266,13 @@ var ServiceConsumer = class _ServiceConsumer { } catch (error) { const webError = error; exception = webError; - response = webError.getResponse(); + if (typeof webError.getResponse !== "function") { + console.error("[SAT Library] Error no-WebClientException capturado en ServiceConsumer.execute:", error); + const fallbackResponse = new CResponse(0, String(error && error.message ? error.message : error), {}); + response = fallbackResponse; + } else { + response = webError.getResponse(); + } } this.checkErrors(request, response, exception); return response.getBody();