| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Remove the line to disable the "github/no-then" rule.
|
This area is surprisingly tricky. The problem is that we're going from non-async code into async code and we need to catch any errors that happen within. Async stuff is just syntactic sugar around promises so that's why we call the async run function non-async and use catch explicitly. You can't use async at the top level in a file, or at least if you do it doesn't behave as you'd want it to. Your solution here looks like it should work, but I'd like to test it to make sure. If errors are still reported correctly then LGTM. |
Sorry, something went wrong.
|
Ok, I've tried it out (didn't take long) and the error handling is working exactly as it was before, so I'm happy with this and it gets us one eslint rule closer. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Merge / deployment checklist
Closes #200 by wrapping the calls to run()-like functions that had .catch appended (possibly to avoid warnings by the @typescript/no-floating-promises rule?) in functions that catch potential errors using a try-catch statement.
The void in front of the runWrapper function is necessary to avoid warnings by the @typescript/no-floating-promises rule.