NSLS-II / metadatastore

DEPRECATED: Incorporated into https://github.com/NSLS-II/databroker
Other
2 stars 11 forks source link

mds.run_start_given_uid fails cryptically if given unknown uid #205

Closed danielballan closed 8 years ago

danielballan commented 8 years ago

mds.run_start_given_uid(uid='some unknown uid') should fail better. Currently it fails here:

    def _cache_run_start(run_start, run_start_cache):
        """De-reference and cache a RunStart document

        The de-referenced Document is cached against the
        ObjectId and the uid -> ObjectID mapping is stored.

        Parameters
        ----------
        run_start : dict
            raw pymongo dictionary. This is expected to have
            an entry `_id` with the ObjectId used by mongo.

        Returns
        -------
        run_start : doc.Document
            Document instance for this RunStart document.
            The ObjectId has been stripped.
        """
>       run_start = dict(run_start)
E       TypeError: 'NoneType' object is not iterable