@rf-logger/logger 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -59,8 +59,12 @@ class ErrorFormat {
|
|
|
59
59
|
const errorInfo = this.formatError(error);
|
|
60
60
|
this.forwardError(error, errorInfo.id, info);
|
|
61
61
|
const causes = this.handleCauses(error, errorInfo.id);
|
|
62
|
+
// Never log AxiosError properties as they can contain Bearer tokens.
|
|
63
|
+
// Users can already get more info about such error with the @rf-logger/logger-axios plugin.
|
|
64
|
+
const isAxiosError = info.isAxiosError || info.name === "AxiosError";
|
|
65
|
+
const safeInfo = isAxiosError ? {} : info;
|
|
62
66
|
return {
|
|
63
|
-
...
|
|
67
|
+
...safeInfo,
|
|
64
68
|
level: info.level,
|
|
65
69
|
[triple_beam_1.LEVEL]: info.level,
|
|
66
70
|
message,
|