Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

invalid project id error handling #71

Open
lordnynex opened this issue Sep 17, 2015 · 1 comment
Open

invalid project id error handling #71

lordnynex opened this issue Sep 17, 2015 · 1 comment
Labels

Comments

@lordnynex
Copy link

I accidentally supplied a workspace ID instead of a project ID

This yields the following trace

Exception: TypeError('%d format: a number is required, not str',)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/asana_hub/tool.py", line 446, in __init__
    action.run()
  File "/usr/local/lib/python2.7/dist-packages/asana_hub/actions/sync.py", line 107, in run
    repo, project = self.get_repo_and_project()
  File "/usr/local/lib/python2.7/dist-packages/asana_hub/action.py", line 81, in get_repo_and_project
    on_save=lambda p: p['id']
  File "/usr/local/lib/python2.7/dist-packages/asana_hub/json_data.py", line 95, in apply
    value = on_load(value)
  File "/usr/local/lib/python2.7/dist-packages/asana/resources/gen/projects.py", line 73, in find_by_id
    path = "/projects/%d" % (project)
TypeError: %d format: a number is required, not str

Further, this invalid ID is persisted to the .proj file which squelches the same trace on every run.

To fix this I had to delete the .proj file and sync

@soundofjw
Copy link

Nice catch, there should be up front validation.
You can change the project ID via CLI with --project

@soundofjw soundofjw added the bug label Sep 17, 2015
@soundofjw soundofjw added this to the v1.0 - Release milestone Sep 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants