---
title: "User define exception class"  
description: "User define exception class"  
author: "Anonymous User"  
published: 2013-06-13  
updated: 2013-06-13  
canonical: https://www.mindstick.com/forum/1062/user-define-exception-class  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# User define exception class

Hi Guys\
Can [someone tell me](https://www.mindstick.com/forum/34097/can-someone-tell-me-what-is-the-most-effective-optimization-on-page-optimization-or-off-page-optimization) a small example for [custom](https://www.mindstick.com/blog/12298/use-custom-writing-services-to-get-through-the-finals) ([User](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) [define](https://yourviews.mindstick.com/audio/1110/lifestyles-choices-that-define-our-lives) ) [exception](https://www.mindstick.com/articles/1824/objective-c-exception-handling) class.\
Thanks

## Replies

### Reply by Vijay Shukla

Hello Pravesh Singh!\
Below I Provide you a demo code for user define exception class.\

```
using System;namespace MindstickCustomeExceptionDemo{    public class MindstickEmployeeListNotFoundException : Exception    {        public MindstickEmployeeListNotFoundException()        {        }        public MindstickEmployeeListNotFoundException(string message)            : base(message)        {        }    }    class CustomException    {        static void Main(string[] args)        {            try            {                throw new MindstickEmployeeListNotFoundException("\n\n::Mindstick Employee List not found::\n\n");            }            catch (MindstickEmployeeListNotFoundException ce)            {                Console.WriteLine(ce.ToString());            }            Console.ReadKey();        }    }}
```

\

If you want to more knowledge about User define exception class read this link\


---

Original Source: https://www.mindstick.com/forum/1062/user-define-exception-class

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
