AssertionException.cs 658 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. namespace XGame.Framework.Assertions
  3. {
  4. public class AssertionException : Exception
  5. {
  6. string m_UserMessage;
  7. public AssertionException(string message, string userMessage)
  8. : base(message)
  9. {
  10. m_UserMessage = userMessage;
  11. }
  12. public override string Message
  13. {
  14. get
  15. {
  16. var message = "【XGame Assert】 ";
  17. if (m_UserMessage != null)
  18. message += m_UserMessage;
  19. message += "\n";
  20. message += base.Message;
  21. return message;
  22. }
  23. }
  24. }
  25. }