i think it might give more useful info to users to split up this error message to be more specific about the reason for the failure, something like:
```
if num < 0:
    raise ValueError("Invalid num < 0 supplied for Catalog: num = %d" % num)
elif num >= len(base['catalog']):
    raise ValueError("Invalid num supplied for Catalog (too large): num = %d" % num)
```