From 1aec9dbd82b12e6584a106793d36f916a40e2d4f Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@gmail.com> Date: Tue, 26 Jan 2021 10:56:59 +0100 Subject: [PATCH] Proper link in exceptions.md --- devNotes/exceptions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/devNotes/exceptions.md b/devNotes/exceptions.md index 0abe7704403..f7a66be9a1c 100644 --- a/devNotes/exceptions.md +++ b/devNotes/exceptions.md @@ -2,10 +2,10 @@ With the movement away from passages as .tw files error handling is getting more important, especially proper cleanup. -Good example is #2654, the end week animation did not stop because `App.EndWeek.slaveAssignmentReport()` failed, which +Good example is [this issue](https://gitgud.io/pregmodfan/fc-pregmod/-/issues/2654), the end week animation did not stop because `App.EndWeek.slaveAssignmentReport()` failed, which meant that the endweek animation stop call wasn't executed. -### Finally +## Finally Example of the proper way to handle code that cleans up something and should therefore always be executed: @@ -22,7 +22,7 @@ try { Do note that this will still propagate the error up, it will just execute `cleanup code` first. If you want to handle the error use `catch` -### Catch +## Catch If needed a catch clause can be used as well, but it is usually advisable to only catch specific errors and only if you know they can be thrown and there is no easy way to prevent them. @@ -37,6 +37,6 @@ try { } ``` -### Reference +## Reference See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch -- GitLab