Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ScriptRuntimeException.cs
1using System;
3
5{
10 {
11 private readonly ScriptNode node;
12
18 public ScriptRuntimeException(string Message, ScriptNode Node)
19 : base(Join(Message, Node))
20 {
21 this.node = Node;
22 }
23
30 public ScriptRuntimeException(string Message, ScriptNode Node, Exception InnerException)
31 : base(Join(Message, Node), InnerException)
32 {
33 this.node = Node;
34 }
35
36 private static string Join(string Message, ScriptNode Node)
37 {
38 if (Node is null)
39 return Message;
40
41 string s = Node.SubExpression;
42 if (s.Length > 1000)
43 s = s.Substring(0, 1000) + "...";
44
45 return Message + "\r\n\r\n" + s;
46 }
47
51 public ScriptNode Node => this.node;
52
53 }
54}
Base class for script exceptions.
ScriptNode Node
Node where error occurred.
ScriptRuntimeException(string Message, ScriptNode Node)
Script runtime exception.
ScriptRuntimeException(string Message, ScriptNode Node, Exception InnerException)
Script runtime exception.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
string SubExpression
Sub-expression defining the node.
Definition: ScriptNode.cs:183