Skip to content

Commit

Permalink
Fix missing usages of MessageTransformer for Throwable sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
MaisiKoleni committed Mar 23, 2021
1 parent ee5acb8 commit e7b172f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Throwable sanitize(Throwable t, MessageTransformer messageTransformer) {
* So we just pass the message constructed be the old object, as the new object
* will in absence of failures only return the heading.
*/
MultipleFailuresError newMfe = createNewInstance(mfe, info.getMessage(), List.of());
MultipleFailuresError newMfe = createNewInstance(mfe, messageTransformer.apply(info), List.of());
SanitizationUtils.copyThrowableInfoSafe(info, newMfe);
// Retain failure information in the suppressed Throwables
for (Throwable failure : failures)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public Throwable sanitize(Throwable t, MessageTransformer messageTransformer) {
// this is OK because we are only dealing with safe types here
ThrowableInfo info = ThrowableInfo.of(type, ThrowableUtils.retrievePropertyValues(t));
info.sanitize(ThrowableUtils.PROPERTY_SANITIZER);
info.setMessage(messageTransformer.apply(info));
var throwableCreator = cachedThrowableCreators.computeIfAbsent(type, this::findThrowableCreator);
try {
Throwable newInstance = throwableCreator.create(info);
Expand Down

0 comments on commit e7b172f

Please sign in to comment.