Skip to content

Commit

Permalink
[Misc] Added comment to explain why, with Adel, we couldn't write a n…
Browse files Browse the repository at this point in the history
…on-contrived unit test testing the MalformedURLException catch.... ;)
  • Loading branch information
vmassol committed May 3, 2018
1 parent 58230a8 commit 7fefcb8
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -59,6 +59,10 @@ public URL getURL(DocumentReference reference) throws XWikiRestException
}
return url;
} catch (MalformedURLException e) {
// Note: The method getBaseURI() always return a valid URL (because it uses XWikiURLFactory#getServerURL()
// which is a URL). Thus calling Utils.createURI().toURL() should always return a valid URL normally.
// Thus getBaseURI() should probably be named getBaseURL() and Utils.createURI() should probaby be named
// Utils.createURL()...
throw new XWikiRestException(
String.format("Failed to generate a REST URL for the document [%s].", reference), e);
}
Expand Down

0 comments on commit 7fefcb8

Please sign in to comment.