aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-29 19:10:09 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-29 19:10:09 +0000
commitba003a16e51b0316233157893b6572aa01616c77 (patch)
treedec02dc554f2745977d5985628de0d5f0d6e8a1b
parent2f82314374a644952019ac34b59dff10f6470004 (diff)
Fail faster
Better error reporting when an incoming message has no raw_email. This is useful if you make a mistake when creating new test data, to pick an example application completely at random (not).
-rw-r--r--app/models/incoming_message.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 91f1cf7c0..131970ba6 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -127,6 +127,9 @@ class IncomingMessage < ActiveRecord::Base
# The following fields may be absent; we treat them as cached
# values in case we want to regenerate them (due to mail
# parsing bugs, etc).
+ if self.raw_email.nil?
+ raise "Incoming message id=#{id} has no raw_email"
+ end
if (!force.nil? || self.last_parsed.nil?)
ActiveRecord::Base.transaction do
self.extract_attachments!