Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

wah_on_2

My Exception classes

This topic is 5609 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hihi, i am writing utilities classes using C#. The utilities contain my own exceptional classes. Until now, my design about the exceptional classes is that: I have my expceitonal class and inherit from ApplicationException and i will assign a message to it when creating the instance of it for more details to identify what''s the problems are. The message is not hardcode in program, the exceptional classes will call a MessageReader class to get the message from a text file by passing a MessageKey for mapping. In this case, i should collect all the messages in a text file, and i confuse with that. I think i should seperate the different exception''s message in different file. For example, at least i will have Common Message(e.g. Out of range) and Applicaiton Message(e.g. field cannot be empty). And then, when the program create common''s exception, the MessageReader will get ,message from common file. However, if i use this method, i will have many message file and it seem difficult to maintain. So i want to know how to do the exception class in a better way? How the .NET to do it? Is it same with me? Does my method correct?

Share this post


Link to post
Share on other sites
Advertisement
If anyone know how to do exception without hardcode the message in the program. Pls share expenience with me. I feel difficult to handle it.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!