Comment 2 for bug 432766

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote : Re: [Bug 432766] Re: Cannot add a milestone

This is the url generating the "No such operation: get_timeline" error:
  https://edge.launchpad.net/api/beta/divisiui/releases?ws.op=get_timeline&include_inactive=true

Interestingly, the other series does not have this error. Neither does
the project itself, which is surprising, because the
project.get_timeline() actually calls each series.get_timeline().
  https://edge.launchpad.net/api/beta/divisiui/prototype?ws.op=get_timeline&include_inactive=true
  https://edge.launchpad.net/api/beta/divisiui?ws.op=get_timeline&include_inactive=true

I traced down the error message to this method in
lazr/restful/_resource.py. I have no idea why one series would get a
ComponentLookupError and not the other one. Because it catches the
exception, there is no useful information in the logs.

    def handleCustomGET(self, operation_name):
        """Execute a custom search-type operation triggered through GET.

        This is used by both EntryResource and CollectionResource.

        :param operation_name: The name of the operation to invoke.
        :return: The result of the operation: either a string or an
        object that needs to be serialized to JSON.
        """
        try:
            operation = getMultiAdapter((self.context, self.request),
                                        IResourceGETOperation,
                                        name=operation_name)
        except ComponentLookupError:
            self.request.response.setStatus(400)
            return "No such operation: " + operation_name
        return operation()