Skip to content

Instantly share code, notes, and snippets.

@jmaxxz
Created April 23, 2012 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmaxxz/2474399 to your computer and use it in GitHub Desktop.
Save jmaxxz/2474399 to your computer and use it in GitHub Desktop.
You can't handle the truth
using System;
namespace Truth
{
class Program
{
static void Main(string[] args)
{
try
{
throw new TheTruth();
}
catch (Exception)
{
throw;
}
}
}
}
using System;namespace Truth { public class TheTruth : Exception {public TheTruth(){} private TheTruth(int b) { Console.WriteLine("The truth");} public override string StackTrace { get { throw new TheTruth(1); } } public override System.Collections.IDictionary Data { get { throw new TheTruth(1); } } public override string ToString() { throw new TheTruth(1); } public override Exception GetBaseException() { throw new TheTruth(1); } public override bool Equals(object obj) { throw new TheTruth(1); } public override int GetHashCode() { throw new TheTruth(1); } public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { throw new TheTruth(1); } public override string HelpLink { get { throw new TheTruth(1); } set { throw new TheTruth(1); } } public override string Message { get { throw new TheTruth(1); } } public override string Source { get { throw new TheTruth(1); } set { throw new TheTruth(1); } } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment