This change wraps the MissingContentException that gets thrown due to invalid SXS label requests so that it raises an Http404 instead of causing a 500 error.
This can be tested by trying to manually access an invalid URL for a section for which no SXS analysis exists. These URLs should never be generated in a browser, but might be generated e.g. by URL hacking or by bots/crawlers.
An example URL that currently causes a problem for Reg E is:
This change wraps the
MissingContentException
that gets thrown due to invalid SXS label requests so that it raises anHttp404
instead of causing a 500 error.This can be tested by trying to manually access an invalid URL for a section for which no SXS analysis exists. These URLs should never be generated in a browser, but might be generated e.g. by URL hacking or by bots/crawlers.
An example URL that currently causes a problem for Reg E is:
http://localhost:8000/eregulations/partial/sxs/1005-31-a/2012-1728?from_version=2016-24506#1005-31-a
This raises a 500 because there's no
1005-31-a
label in the SXSanalysis, unlike a valid section like:http://localhost:8000/eregulations/partial/sxs/1005-31/2012-1728?from_version=2016-24506#1005-31