Details
-
Improvement
-
Resolution: Won't Fix
-
Major
-
None
-
None
-
None
-
Unknown
-
Description
The script service ($services.releasenotes) and the REST endpoints both refuse a release note with no version, a change with no title, and a release note or change with no product in a wiki that has no default product. Today:
- the REST endpoints check these by hand before calling the API, with their own messages, and the managers check them again;
- the script service and the Java API throw a plain ReleaseNotesException, which a caller cannot tell apart from a failure of the wiki (a store error, a cancelled save).
Add org.xwiki.contrib.releasenotes.ReleaseNotesInvalidException (a ReleaseNotesException), thrown by the API for input it refuses, and have the REST exception mapper answer it with a 400. A script can then tell "what I sent is wrong" from "the wiki failed", and the REST endpoints stop duplicating the API's checks.