Which module(s) and week(s) does this change affect?
Module(s): ITP, earlier than Data Flows (e.g. Structuring Data or Data Groups), plus Data Flows Sprint 3 for the async follow-up
Week(s): To be decided
What is the work that needs to be done?
We want to properly cover error handling:
- What exceptions are and what happens when one goes unhandled
- What try/catch is and how to use it
- When you should throw vs handle the error another way (return a value, log, recover, re-throw)
- How to handle errors well: catching at the right level, not swallowing errors, giving users/callers useful information
There is an existing block, common-content/en/module/js3/catch, which covers try/catch around async fetch calls. It was deliberately removed from Data Flows Sprint 3 prep in 4f8508c (#1111), with this rationale in the commit message:
- We haven't actually taught
try-catch anywhere, so we can't just rely on transferring "it's the same as you already know, just async".
- There are already way too many novel concepts in Data Flows Sprint 3, and it's already very hard to follow from scratch.
If we add try-catch earlier in the course (which I think we should), we should re-add this.
So the work is likely two parts:
- Introduce error handling fundamentals earlier in the course, in a synchronous context
- Re-add the
js3/catch block (or an updated version) to Data Flows Sprint 3, building on that foundation
Why is this work important to do?
Trainees currently learn fetch, promises, and async/await without ever being taught what to do when things fail. The removal in #1111 was explicitly conditional on teaching this earlier, which hasn't happened yet.
Who might need to know about this change?
@illicitonion
Which module(s) and week(s) does this change affect?
Module(s): ITP, earlier than Data Flows (e.g. Structuring Data or Data Groups), plus Data Flows Sprint 3 for the async follow-up
Week(s): To be decided
What is the work that needs to be done?
We want to properly cover error handling:
There is an existing block,
common-content/en/module/js3/catch, which covers try/catch around async fetch calls. It was deliberately removed from Data Flows Sprint 3 prep in 4f8508c (#1111), with this rationale in the commit message:So the work is likely two parts:
js3/catchblock (or an updated version) to Data Flows Sprint 3, building on that foundationWhy is this work important to do?
Trainees currently learn fetch, promises, and async/await without ever being taught what to do when things fail. The removal in #1111 was explicitly conditional on teaching this earlier, which hasn't happened yet.
Who might need to know about this change?
@illicitonion