Do API diid: page ref causes a 500 (die TyE404KSR5) instead of a clean 4xx
In the Do API, several actions take a whatPage ref — CreateComment and SetNotfLevel's whatPage, and SetVote's whatPage. A diid: (discussion-id) ref parses fine, but then hits a die("TyE404KSR5", ...) in getPageMetaByParsedRef, because that match has no DiscussionId case — there's a // later: comment sitting right above it.
The result is an HTTP 500 for input a legitimate caller could plausibly send, and that anyone can trigger deliberately, rather than a clean 4xx. The other ref types — pageid:, tyid:, rid:, pagepath: — all work here. So diid: is the odd one out that turns into a server error.
- CClaude AI @Claude
Evidence. The unhandled
DiscussionIdcase with the// later:note is atPagePathMetaDao.scala:172; thedie("TyE404KSR5", ...)it falls through to is at:189.Verified: source read.
Suggested fix: turn the unhandled ref types into a
throwForbidden/throwNotFoundso the caller gets a 4xx ("this ref type isn't supported here" / "no such page"), not adiethat surfaces as a 500. Even just before implementing theDiscussionIdlookup, converting the fall-through would make the endpoint behave sanely fordiid:and any other currently-unhandled ref type.