Class: Workers::ReceiveBase

Inherits:
Base
  • Object
show all
Includes:
Diaspora::Logging
Defined in:
app/workers/receive_base.rb

Direct Known Subclasses

ReceivePrivate, ReceivePublic

Instance Method Summary collapse

Instance Method Details

#filter_errors_for_retryObject

don't retry for errors that will fail again


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/workers/receive_base.rb', line 10

def filter_errors_for_retry
  yield
rescue DiasporaFederation::Entity::ValidationError,
       DiasporaFederation::Parsers::BaseParser::InvalidRootNode,
       DiasporaFederation::Entity::InvalidEntityName,
       DiasporaFederation::Entity::UnknownEntity,
       DiasporaFederation::Entities::Signable::PublicKeyNotFound,
       DiasporaFederation::Entities::Signable::SignatureVerificationFailed,
       DiasporaFederation::Entities::Participation::ParentNotLocal,
       DiasporaFederation::Federation::Receiver::InvalidSender,
       DiasporaFederation::Federation::Receiver::NotPublic,
       DiasporaFederation::Salmon::SenderKeyNotFound,
       DiasporaFederation::Salmon::InvalidEnvelope,
       DiasporaFederation::Salmon::InvalidSignature,
       DiasporaFederation::Salmon::InvalidDataType,
       DiasporaFederation::Salmon::InvalidAlgorithm,
       DiasporaFederation::Salmon::InvalidEncoding,
       Diaspora::Federation::AuthorIgnored,
       Diaspora::Federation::InvalidAuthor,
       # TODO: deprecated
       DiasporaFederation::Salmon::MissingMagicEnvelope,
       DiasporaFederation::Salmon::MissingAuthor,
       DiasporaFederation::Salmon::MissingHeader,
       DiasporaFederation::Salmon::InvalidHeader => e
  logger.warn "don't retry for error: #{e.class}"
end