AllenInstitute / datacube

Other
0 stars 1 forks source link

should exclude "pixel = None for len() check in preprare_file #79

Open shus2018 opened 6 years ago

shus2018 commented 6 years ago

seeing errors like {"error": "wamp.error.runtime_error", "args": ["object of type 'NoneType' has no len()"], "kwargs": {}} and logs like "builtins.TypeError: object of type 'NoneType' has no len()".

Not huge deal but nice to get a more readable and clean logs instead of runtime error.

This is the lowest priority. :-)

We do have check from the following function

filmstrip_location (pixel = None, distanceMapPath = None, direction = None): results = dict() results.setdefault("success", False)

        # Validate Arguments
        if pixel == None or distanceMapPath == None or direction == None:
            status = results.setdefault("status", dict())

status.setdefault("message", "missing pixel, distanceMapPath, or direction argument(s)")

NO check for len() function from prepare_files def prepare_files(self, pixel, distance_map_path, direction): if len(pixel) != 2: