/
kOSException.cs
37 lines (33 loc) · 965 Bytes
/
kOSException.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace kOS
{
public class kOSException : Exception
{
public new String Message;
public String Filename;
public int LineNumber;
public Command commandObj;
public ExecutionContext Context;
public ContextRunProgram Program;
public kOSException(String message)
{
this.Message = message;
//this.commandObj = commandObj;
}
public kOSException(String message, ExecutionContext context) : this (message)
{
this.LineNumber = context.Line;
this.Context = context;
this.Program = context.FindClosestParentOfType<ContextRunProgram>();
}
}
public class kOSReadOnlyException : kOSException
{
public kOSReadOnlyException(String varName) : base (varName + " is read-only")
{
}
}
}