Skip to content

Instantly share code, notes, and snippets.

@lewis-munyi
Last active November 19, 2025 19:23
Show Gist options
  • Select an option

  • Save lewis-munyi/11b6e7705e8064d82225c70e6479c377 to your computer and use it in GitHub Desktop.

Select an option

Save lewis-munyi/11b6e7705e8064d82225c70e6479c377 to your computer and use it in GitHub Desktop.
VS code Try-catch snippet
{
"Stackoverflow Try-Catch": {
"prefix": "trycatch",
"body": [
"try{",
" ${1:// Something}",
"} catch(error) {",
" ${2:console.error('Exception ' + error);",
" ${3:window.open('https://stackoverflow.com/search?q=[js]' + error.message, '_blank');}}",
"}",
"$0"
],
"description": "An awesome try-catch statement"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment