MCPcopy Create free account
hub / github.com/SplootCode/splootcode / applyRuntimeError

Method applyRuntimeError

packages/core/src/language/node.ts:205–237  ·  view source on GitHub ↗
(capture: StatementCapture)

Source from the content-addressed store, hash-verified

203 }
204
205 applyRuntimeError(capture: StatementCapture) {
206 const mutation = new NodeMutation()
207 mutation.node = this
208 mutation.type = NodeMutationType.SET_RUNTIME_ANNOTATIONS
209 if (capture.exceptionInFunction) {
210 mutation.annotations = [
211 {
212 type: NodeAnnotationType.SideEffect,
213 value: {
214 message: `Exception in ${capture.exceptionInFunction}`,
215 },
216 },
217 {
218 type: NodeAnnotationType.RuntimeError,
219 value: {
220 errorType: capture.exceptionType,
221 errorMessage: capture.exceptionMessage,
222 },
223 },
224 ]
225 } else {
226 mutation.annotations = [
227 {
228 type: NodeAnnotationType.RuntimeError,
229 value: {
230 errorType: capture.exceptionType,
231 errorMessage: capture.exceptionMessage,
232 },
233 },
234 ]
235 }
236 this.fireMutation(mutation)
237 }
238
239 recursivelySetMutations(enable: boolean) {
240 this.enableMutations = enable

Callers 1

Calls 1

fireMutationMethod · 0.95

Tested by

no test coverage detected