Skip to content

Update typescript.code-snippets#98521

Merged
mjbvz merged 1 commit intomicrosoft:masterfrom
Jack-Works:patch-1
May 27, 2020
Merged

Update typescript.code-snippets#98521
mjbvz merged 1 commit intomicrosoft:masterfrom
Jack-Works:patch-1

Conversation

@Jack-Works
Copy link
Contributor

  1. Change code snippet throw "$1" to throw new Error("$1"). Throw a string is a bad practice because it will drop the execution stack.
  2. Add a new snippet for await of

@kieferrm kieferrm requested a review from mjbvz May 25, 2020 22:44
@mjbvz
Copy link
Collaborator

mjbvz commented May 26, 2020

The for await addition looks good but I don't think we should change the throw. This snippet has bee there for a while so changing it may break people's workflows (for example, if you are using it to rethrow an exception)

@Jack-Works
Copy link
Contributor Author

Hmm how to use it to rethrow exception? It provides a string as default

@mjbvz mjbvz merged commit ece530a into microsoft:master May 27, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented May 27, 2020

Good point. This looks like an improvement then.

Thanks, this will be in the next VS Code insiders build

@mjbvz mjbvz added this to the May 2020 milestone May 27, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants