SOLR-13324 - Don't swallow/print exception in URLClassifyProcessor anymore

This commit is contained in:
Gus Heck 2019-03-24 19:07:26 -04:00
parent bca22d58e2
commit c60685f9e4
2 changed files with 22 additions and 23 deletions

View File

@ -41,6 +41,10 @@ Upgrade Notes
expanding the 'expr' parameter can be reinstated with -DStreamingExpressionMacros=true passed to the JVM at startup expanding the 'expr' parameter can be reinstated with -DStreamingExpressionMacros=true passed to the JVM at startup
(Gus Heck). (Gus Heck).
* SOLR-13324: URLClassifyProcessor#getCanonicalUrl now throws MalformedURLException rather than hiding it. Although the
present code is unlikely to produce such an exception it may be possible in future changes or in subclasses.
Currently this change should only effect compatibility of custom code overriding this method (Gus Heck).
New Features New Features
---------------------- ----------------------
* SOLR-13131: Category Routed Aliases are now available for data driven assignment of documents to collections based on * SOLR-13131: Category Routed Aliases are now available for data driven assignment of documents to collections based on

View File

@ -139,16 +139,11 @@ public class URLClassifyProcessor extends UpdateRequestProcessor {
* @param url The input url * @param url The input url
* @return The URL object representing the canonical URL * @return The URL object representing the canonical URL
*/ */
public URL getCanonicalUrl(URL url) { public URL getCanonicalUrl(URL url) throws MalformedURLException {
// NOTE: Do we want to make sure this URL is normalized? (Christian thinks we should) // NOTE: Do we want to make sure this URL is normalized? (Christian thinks we should)
String urlString = url.toString(); String urlString = url.toString();
try {
String lps = landingPageSuffix(url); String lps = landingPageSuffix(url);
return new URL(urlString.replaceFirst("/" + lps + "$", "/")); return new URL(urlString.replaceFirst("/" + lps + "$", "/"));
} catch (MalformedURLException e) {
e.printStackTrace();
}
return url;
} }
/** /**