Skip to content
This repository was archived by the owner on Oct 3, 2019. It is now read-only.
This repository was archived by the owner on Oct 3, 2019. It is now read-only.

Giving wrong course name cause an uncaught exception #2

Description

@Aaylor

When running courses:show option, if the course name is incorrect, it makes an uncaught exception.

$ didel courses:show LOV
Traceback (most recent call last):
  File "/usr/local/bin/didel", line 8, in <module>
    load_entry_point('didelcli==0.1.0', 'console_scripts', 'didel')()
  File "/Library/Python/2.7/site-packages/didel/cli.py", line 259, in run
    ret = DidelCli(argv).run()
  File "/Library/Python/2.7/site-packages/didel/cli.py", line 251, in run
    return fun(*argv)
  File "/Library/Python/2.7/site-packages/didel/cli.py", line 128, in action_courses_show
    course = self.get_course(code)
  File "/Library/Python/2.7/site-packages/didel/cli.py", line 42, in get_course
    return s.get_course(code)
  File "/Library/Python/2.7/site-packages/didel/student.py", line 38, in get_course
    c.fetch(self.session)
  File "/Library/Python/2.7/site-packages/didel/base.py", line 64, in fetch
    populate(soup, session)
  File "/Library/Python/2.7/site-packages/didel/courses.py", line 116, in populate
    header = soup.select('.courseInfos')[0]
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions