// // // // // $Revision$ // namespace Debugger.Expressions { /// /// An expression which returns the current exception on the thread /// public class CurrentExceptionExpression: Expression { public override string Code { get { return "$exception"; } } protected override Value EvaluateInternal(StackFrame context) { if (context.Thread.CurrentException != null) { return context.Thread.CurrentException.Value; } else { throw new GetValueException("No current exception"); } } #region GetHashCode and Equals public override int GetHashCode() { return typeof(CurrentExceptionExpression).GetHashCode(); } public override bool Equals(object obj) { return obj is CurrentExceptionExpression; } #endregion } }