@nclabs/nestjs-rpc-module
Advanced tools
Comparing version 0.1.33 to 0.1.34
@@ -59,5 +59,5 @@ "use strict"; | ||
const contentType = error?.response?.headers['content-type'] || ''; | ||
const message = contentType.includes('text/html') | ||
? this._htmlToText(error.response.data) | ||
: error.response?.data?.message || error.message; | ||
// console.log(error.response?.data); | ||
const isHtml = contentType.includes('text/html'); | ||
const message = isHtml ? this._htmlToText(error.response.data) : error.message; | ||
return { | ||
@@ -69,3 +69,3 @@ code: error?.response?.status || 400, | ||
instanceof: 'AxiosError', | ||
...(error?.response?.data || {}), | ||
data: error.response?.data || {}, | ||
}, | ||
@@ -82,6 +82,3 @@ }; | ||
const textBody = body.replace(/<[^>]+>/g, ''); | ||
return { | ||
instanceof: 'HtmlError', | ||
body: textBody, | ||
}; | ||
return textBody; | ||
} | ||
@@ -88,0 +85,0 @@ /** |
{ | ||
"name": "@nclabs/nestjs-rpc-module", | ||
"version": "0.1.33", | ||
"version": "0.1.34", | ||
"description": "Utilitário NestJS para configuração de rotas e cache em microsserviços. Utilizado especificamente para projetos nclabs", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
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
438819
3605