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.Missinghttps://github.com/cs50/check50/pull/198 🤞) bewaren extra attributen (expected & actual) om te laten zien in de webview. Daarin staat bijvoorbeeld de hele traceback! :)
Reraise een potentiële
check50.Mismatch
niet alscheck50.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:
Dit is belangrijk omdat je anders potentieel extra informatie weggooit. Bijvoorbeeld
check50.Mismatch
(en binnenkortcheck50.Missing
https://github.com/cs50/check50/pull/198 🤞) bewaren extra attributen (expected
&actual
) om te laten zien in de webview. Daarin staat bijvoorbeeld de hele traceback! :)