Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure PathResourceResolvers log warnings for non-existent resources
Prior to this commit, the getResource() methods in PathResourceResolver implementations allowed an exception thrown from Resource#getURL() to propagate instead of logging a warning about the missing resource as intended. This commit modifies the getResource() methods in PathResourceResolver implementations so that the log messages include the output of the toString() implementations of the underlying resources instead of their getURL() implementations, which may throw an exception. Furthermore, logging the toString() output of resources aligns with the existing output for "allowed locations" in the same log message. Note that the toString() implementations could potentially also throw exceptions, but that is considered less likely. See gh-31623 Closes gh-31624 (cherry picked from commit 7d2ea7e)
- Loading branch information