Skip to content

Commit 2b102ab

Browse files
committed
Add try catch and TthrowOnError
1 parent a74f179 commit 2b102ab

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

snippets/objectscript.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,14 @@
3939
"prefix": ["While"],
4040
"body": ["while ($1) {", "\t$0", "}"],
4141
"description": "While loop"
42-
}
42+
},
43+
"ThrowOnError": {
44+
"prefix": ["$$$ThrowOnError"],
45+
"body": ["$$$$ThrowOnError(##class(${1:class}).${2:method}())"]
46+
},
47+
"Try Catch": {
48+
"prefix": ["Try"],
49+
"body": ["Try {", "\t$0", "}" , "Catch ex {", "\tSet tSC=ex.AsStatus()", "}"],
50+
"description": "Try Catch"
51+
}
4352
}

0 commit comments

Comments
 (0)