BadScript 2
Loading...
Searching...
No Matches
BadRuntimeException.cs
Go to the documentation of this file.
3
5
10{
15 public BadRuntimeException(string message) : base(message) { }
16
17
23 public BadRuntimeException(string message, BadSourcePosition position) : base(
24 $"{message} at {position.GetPositionInfo()}",
25 message,
26 position
27 ) { }
28
35 public static BadRuntimeException Create(BadScope? scope, string message)
36 {
37 if (scope != null && BadRuntimeSettings.Instance.WriteStackTraceInRuntimeErrors)
38 {
39 message = message + Environment.NewLine + scope.GetStackTrace();
40 }
41
42 return new BadRuntimeException(message);
43 }
44
52 public static BadRuntimeException Create(BadScope? scope, string message, BadSourcePosition? pos)
53 {
54 if (scope != null && BadRuntimeSettings.Instance.WriteStackTraceInRuntimeErrors)
55 {
56 message = message + Environment.NewLine + scope.GetStackTrace();
57 }
58
59 return pos == null ? new BadRuntimeException(message) : new BadRuntimeException(message, pos);
60 }
61}
The base class of all BadScript Exceptions.
Describes a specific position inside a source file.
Implements the Scope for the Script Engine.
Definition BadScope.cs:238
string GetStackTrace()
Returns the Stack Trace of the Current scope.
Definition BadScope.cs:633
static BadRuntimeException Create(BadScope? scope, string message, BadSourcePosition? pos)
Creates a new BadScriptException.
BadRuntimeException(string message)
Creates a new BadScriptException.
BadRuntimeException(string message, BadSourcePosition position)
Creates a new BadScriptException.
static BadRuntimeException Create(BadScope? scope, string message)
Creates a new BadScriptException.
static T Instance
Returns the Instance of the Settings Provider.
Contains Shared Data Structures and Functionality.
Contains the Error Objects for the BadScript2 Language.
Contains Runtime Settings Objects.