SHARE
TWEET

Untitled

a guest Sep 16th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Post
  2. {
  3.     private ErrorLogger errorLogger = new ErrorLogger();
  4.  
  5.     void CreatePost(Database db, string postMessage)
  6.     {
  7.         try
  8.         {
  9.             db.Add(postMessage);
  10.         }
  11.         catch (Exception ex)
  12.         {
  13.             errorLogger.log(ex.ToString())
  14.         }
  15.     }
  16. }
  17.  
  18. class ErrorLogger
  19. {
  20.     void log(string error)
  21.     {
  22.       db.LogError("An error occured: ", error);
  23.       File.WriteAllText("\LocalErrors.txt", error);
  24.     }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top