diff --git a/snippets/javascript/javascript.snippets b/snippets/javascript/javascript.snippets index b334a13..2a457e4 100644 --- a/snippets/javascript/javascript.snippets +++ b/snippets/javascript/javascript.snippets @@ -80,6 +80,18 @@ snippet try } catch (${2:e}) { ${0:/* handle error */} } +# try finally +snippet tryf + try { + ${1} + } catch (${2:e}) { + ${0:/* handle error */} + } finally { + ${3:/* be executed regardless of the try / catch result*/} + } +# throw Error +snippet te + throw new Error('${1:error message}') # return snippet ret return ${0:result};