Class: Jobs::Base

Inherits:
Object
  • Object
show all
Defined in:
app/models/jobs/base.rb

Direct Known Subclasses

DeferredDispatch, DeleteAccount, FetchProfilePhoto, FetchPublicPosts, FetchWebfinger, GatherOEmbedData, HttpMulti, Mail::AlsoCommented, Mail::CommentOnPost, Mail::ConfirmEmail, Mail::InviteUserByEmail, Mail::Liked, Mail::Mentioned, Mail::PrivateMessage, Mail::Reshared, Mail::StartedSharing, NotifyLocalUsers, PostToService, ProcessPhoto, PublishToHub, Receive, ReceiveEncryptedSalmon, ReceiveLocalBatch, ReceiveUnencryptedSalmon, ResendInvitation, ResetPassword

Constant Summary

DUMB_ERROR_MESSAGES =

TODO these should be subclassed real exceptions

[
"Contact required unless request",
"Relayable object, but no parent object found" ]

Class Method Summary (collapse)

Class Method Details

+ (Object) suppress_annoying_errors(&block)



14
15
16
17
18
19
20
21
22
23
# File 'app/models/jobs/base.rb', line 14

def self.suppress_annoying_errors(&block)
  begin
    yield
  rescue => e
    Rails.logger.info("error in job: #{e.message}")
    unless DUMB_ERROR_MESSAGES.include?(e.message) 
      raise e
    end
  end
end