Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Exception Handling architecture/framework?

Exception Handling architecture/framework?

Scheduled Pinned Locked Moved C#
csharparchitecturehelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kumar bs
    wrote on last edited by
    #1

    Can anybody give me link or suggestions on implementing good exception handling mechanism in the C# project. Not just try...Catch block but beyond that. I have something in mind, 1. Create something like Error Dictionary (resx file) with user-defined Error Codes, Description and build my own error information with user-defined exception class. 2. This class may accept error code or something for generating good exception object, which can be thrown to the consumer. 3. Exception Consumer will then use this object and pass it to Some class, which eventually will display Vista Type task dialog where atleast Title, Main Instruction and Description of the errors will be shown. Any Inputs are very much appreciated. Thanks

    E 1 Reply Last reply
    0
    • K kumar bs

      Can anybody give me link or suggestions on implementing good exception handling mechanism in the C# project. Not just try...Catch block but beyond that. I have something in mind, 1. Create something like Error Dictionary (resx file) with user-defined Error Codes, Description and build my own error information with user-defined exception class. 2. This class may accept error code or something for generating good exception object, which can be thrown to the consumer. 3. Exception Consumer will then use this object and pass it to Some class, which eventually will display Vista Type task dialog where atleast Title, Main Instruction and Description of the errors will be shown. Any Inputs are very much appreciated. Thanks

      E Offline
      E Offline
      eggsovereasy
      wrote on last edited by
      #2

      Why have a method return an error code which you pass to an error code processing method when you can just throw the appropriate exception when it occurs. Your stack trace looks right that way.

      L K 2 Replies Last reply
      0
      • E eggsovereasy

        Why have a method return an error code which you pass to an error code processing method when you can just throw the appropriate exception when it occurs. Your stack trace looks right that way.

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        eggsovereasy wrote:

        Why have a method return an error code which you pass to an error code processing method when you can just throw the appropriate exception when it occurs.

        Why? Obviously it's an exceptional condition. ;P

        led mike

        1 Reply Last reply
        0
        • E eggsovereasy

          Why have a method return an error code which you pass to an error code processing method when you can just throw the appropriate exception when it occurs. Your stack trace looks right that way.

          K Offline
          K Offline
          kumar bs
          wrote on last edited by
          #4

          Thanks for the reply. Only the thing i want to know is the best design to implement Exception\message Handling, using custom exception classes and resource files contains errors/message keys and descriptions. Thanks

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups