mapbox / tilesets-cli

CLI for interacting with the Mapbox Tilesets API and Mapbox Tiling Service
https://docs.mapbox.com/mapbox-tiling-service
BSD 2-Clause "Simplified" License
125 stars 27 forks source link

missing error message on validation of tileset id #54

Closed almccon closed 4 years ago

almccon commented 4 years ago

When trying a command like this:

tilesets create -r recipe.json -n "name" tileset-id

I get this mysterious error:

Traceback (most recent call last):
  File "/blah/blah/blah/bin/tilesets", line 8, in <module>
    sys.exit(cli())
  File "/blah/blah/blah/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/blah/blah/blah/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/blah/blah/blah/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/blah/blah/blah/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/blah/blah/blah/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/blah/blah/blah/lib/python3.7/site-packages/mapbox_tilesets/scripts/cli.py", line 85, in create
    raise errors.TilesetNameError
TypeError: __init__() missing 1 required positional argument: 'message'

Digging into the code I see that the problem is that my proposed tileset id is invalid, it needs to be something like this:

tilesets create -r recipe.json -n "name" username.tileset-id

Please update the error message and/or the documentation to be clearer that I need to include my username in the tileset id when running create. Thanks!

dianeschulze commented 4 years ago

@almccon thanks for this ticket. This should be addressed by: