+
Skip to content

Print entire traceback or handle gracefully if student's code crashes #380

@curiouskiwi

Description

@curiouskiwi

Currently, if a student's code crashes in check50:

:( lines.py yields 2058 given 2058 lines of code in an open-source library file
    expected: "2058"
    actual:   "Traceback ..."

It would be much more helpful to us all if the Traceback was either shown in its entirely, or somehow interpreted to give the user better help.

Note in this example, the actual traceback was:

Traceback (most recent call last):
  File "/workspaces/6343970/cs50p/lines/lines.py", line 18, in <module>
    if line.strip()[0] != '#':
       ~~~~~~~~~~~~^^^
IndexError: string index out of range

Maybe we can capture that IndexError? Or perhaps simply displaying the entire Traceback is more realistic.

Metadata

Metadata

Assignees

Labels

4.xIssues relating to check50 4.xenhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载