File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,15 @@ def payload(self):
174
174
class ProcessGroupAddedEvent (ProcessGroupEvent ):
175
175
pass
176
176
177
+ class AddProcessGroupFailedEvent (ProcessGroupEvent ):
178
+ def __init__ (self , group , err = None ):
179
+ super ().__init__ (group )
180
+ self .err = err
181
+
182
+ def payload (self ):
183
+ payload = super ().payload ()
184
+ return payload + 'error:%s\n ' % self .err
185
+
177
186
class ProcessGroupRemovedEvent (ProcessGroupEvent ):
178
187
pass
179
188
Original file line number Diff line number Diff line change @@ -114,7 +114,12 @@ def add_process_group(self, config):
114
114
name = config .name
115
115
if name not in self .process_groups :
116
116
config .after_setuid ()
117
- self .process_groups [name ] = config .make_group ()
117
+ try :
118
+ self .process_groups [name ] = config .make_group ()
119
+ except BaseException as why :
120
+ self .options .logger .warn ('Unable to add group %s: %s' % (name , why ))
121
+ events .notify (events .AddProcessGroupFailedEvent (name , why ))
122
+ return False
118
123
events .notify (events .ProcessGroupAddedEvent (name ))
119
124
return True
120
125
return False
You can’t perform that action at this time.
0 commit comments