Skip to content

Fix Adventure (traceback.....) #2

@Jelleas

Description

@Jelleas

Reraise een potentiële check50.Mismatch niet als check50.Failure. Zo
valt bijvoorbeeld bij https://submit.cs50.io/check50/6e18bef1c163dced3b215f4e786db4f6c775a41b in de eerste falende check de traceback weg.

Dit komt omdat er dit in de check staat:

https://github.com/minprog/cs50x/blob/c5a0269403b2b4047ba2d43933f302c71a0f9e5b/adventure/less/__init__.py#L64-L66

Het is hier beter om het volgende te doen:

except check50.Failure as failure:
    failure.rationale = f"Expected the description of initial room when Adventure starts. {failure}"
    raise failure

Dit is belangrijk omdat je anders potentieel extra informatie weggooit. Bijvoorbeeld check50.Mismatch (en binnenkort check50.Missing cs50/check50#198 🤞) bewaren extra attributen (expected & actual) om te laten zien in de webview. Daarin staat bijvoorbeeld de hele traceback! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions