Skip to content

Commit

Permalink
Log CSS exception root cause
Browse files Browse the repository at this point in the history
In XWikiWikiModel, if parsing CSS exception occurs include the root cause of the exception in the log message.
This should help investigation of [XWIKI-20546](https://jira.xwiki.org/browse/XWIKI-20546) issue.
  • Loading branch information
amottier committed Sep 26, 2024
1 parent 2b5f849 commit 63e47dc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import javax.inject.Singleton;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
Expand Down Expand Up @@ -312,7 +313,8 @@ private String getImageDimension(String dimension, Map<String, String> imagePara
value = sd.getPropertyValue(dimension);
} catch (Exception e) {
// Ignore the style parameter but log a warning to let the user know.
this.logger.warn("Failed to parse CSS style [{}]", style, e);
this.logger.warn("Failed to parse CSS style [{}]. Root cause is: [{}]", style,
ExceptionUtils.getRootCauseMessage(e));
}
}
if (StringUtils.isBlank(value)) {
Expand Down

0 comments on commit 63e47dc

Please sign in to comment.