Skip to content

Commit

Permalink
fix #1091 download and/or sender plugin error crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva committed Jun 5, 2024
1 parent e98b26e commit e6ae1c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sarracenia/flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1934,9 +1934,12 @@ def download(self, msg, options) -> bool:
msg['_deleteOnPost'] |= set(['new_inflight_path'])

if 'download' in self.plugins and len(self.plugins['download']) > 0:
ok = False
for plugin in self.plugins['download']:
try:
ok = plugin(msg)
if type(ok) is not bool:
logger.error( f"{plugin} returned {type(ok)}. Should return boolean" )
except Exception as ex:
logger.error( f'flowCallback plugin {plugin} crashed: {ex}' )
logger.debug( "details:", exc_info=True )
Expand Down Expand Up @@ -2213,9 +2216,12 @@ def send(self, msg, options):
(self.scheme, msg['new_dir'], msg['new_file']))

if len(self.plugins['send']) > 0:
ok = False
for plugin in self.plugins['send']:
try:
ok = plugin(msg)
if type(ok) is not bool:
logger.error( f"{plugin} returned {type(ok)}. Should return boolean" )
except Exception as ex:
logger.error( f'flowCallback plugin {plugin} crashed: {ex}' )
logger.debug( "details:", exc_info=True )
Expand Down

0 comments on commit e6ae1c7

Please sign in to comment.