pascalabcnet/Libraries/Debugger.Core/GetValueException.cs
Бондарев Иван e6e67c193c initial commit
2015-05-14 21:35:07 +02:00

57 lines
1.3 KiB
C#

// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.NRefactory.Ast;
namespace Debugger
{
public class GetValueException: DebuggerException
{
INode expression;
string error;
/// <summary> Expression that has caused this exception to occur </summary>
public INode Expression {
get { return expression; }
set { expression = value; }
}
public string Error {
get { return error; }
}
public override string Message {
get {
if (expression == null) {
return error;
} else {
return error;
// return String.Format("Error evaluating \"{0}\": {1}", expression.PrettyPrint(), error);
}
}
}
public GetValueException(INode expression, string error):base(error)
{
this.expression = expression;
this.error = error;
}
public GetValueException(string error, System.Exception inner):base(error, inner)
{
this.error = error;
}
public GetValueException(string errorFmt, params object[] args):base(string.Format(errorFmt, args))
{
this.error = string.Format(errorFmt, args);
}
public GetValueException(string error):base(error)
{
this.error = error;
}
}
}