From 3594d3ba8b81e5901dfdae8287beb51eb2693fba Mon Sep 17 00:00:00 2001
From: Raphael Sofaer <raphael@joindiaspora.com>
Date: Thu, 11 Aug 2011 13:59:31 -0700
Subject: [PATCH] Fix error raising in message after_receive

---
 app/models/message.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/models/message.rb b/app/models/message.rb
index 1f79ad6a46..fb46d91e4e 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -1,3 +1,4 @@
+class NotVisibleError < RuntimeError; end
 class Message < ActiveRecord::Base
   include ROXML
 
@@ -63,7 +64,7 @@ class Message < ActiveRecord::Base
       vis.save
       self
     else
-      raise NotVisibleException("Attempting to access a ConversationVisibility that does not exist!")
+      raise NotVisibleError.new("User #{user.id} with person #{user.person.id} is not allowed to see conversation #{conversation.id}!")
     end
   end
 
-- 
GitLab