File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,13 @@ - (void)performTaskOnQueue:(dispatch_queue_t)queue terminationHandler:(void (^)(
122
122
NSString *desc = @" Task exited unsuccessfully" ;
123
123
NSArray *taskArguments = [@[task.launchPath] arrayByAddingObjectsFromArray: task.arguments];
124
124
NSString *failureReason = [NSString stringWithFormat: @" The task \" %@ \" returned a non-zero return code" , [taskArguments componentsJoinedByString: @" " ]];
125
+ int status = task.terminationStatus ;
126
+ NSNumber *terminationStatus = (status < 255 ? [NSNumber numberWithShort: (short )status] : @(status));
127
+
125
128
NSDictionary *userInfo = @{
126
129
NSLocalizedDescriptionKey : desc,
127
130
NSLocalizedFailureReasonErrorKey : failureReason,
128
- PBTaskTerminationStatusKey: @(task. terminationStatus ) ,
131
+ PBTaskTerminationStatusKey: terminationStatus,
129
132
PBTaskTerminationOutputKey: outputString,
130
133
};
131
134
error = [NSError errorWithDomain: PBTaskErrorDomain code: PBTaskNonZeroExitCodeError userInfo: userInfo];
You can’t perform that action at this time.
0 commit comments