try-catch-finally and throw error

This commit is contained in:
dengyaolong 2015-08-25 13:44:52 +08:00
parent c4883b9f2d
commit b773523c30

View File

@ -80,6 +80,18 @@ snippet try
} catch (${2:e}) { } catch (${2:e}) {
${0:/* handle error */} ${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 # return
snippet ret snippet ret
return ${0:result}; return ${0:result};