User-defined exception

Please edit your post to show the code properly.