File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 15
15
#import " PBGitDefaults.h"
16
16
#import " PBCommitList.h"
17
17
#import " PBGitCommit.h"
18
+ #import " PBError.h"
18
19
19
20
@interface PBHistorySearchController ()
20
21
@@ -420,8 +421,20 @@ - (void)startBackgroundSearch
420
421
}
421
422
422
423
backgroundSearchTask = [historyController.repository taskWithArguments: searchArguments];
423
- [backgroundSearchTask performTaskWithCompletionHandler: ^(NSData * _Nullable readData, NSError * _Nullable error) {
424
+ [backgroundSearchTask performTaskWithCompletionHandler: ^(NSData *readData, NSError *taskError) {
425
+ if (taskError.domain == PBTaskErrorDomain && taskError.code == PBTaskCaughtSignalError) {
426
+ /* Silently ignore task termination */
427
+ return ;
428
+ }
429
+
424
430
if (!readData) {
431
+ [self clearProgressIndicator ];
432
+ NSString *desc = NSLocalizedString(@" Search failed" , @" Search Controller - Background search failed error description" );
433
+ NSString *reason = NSLocalizedString(@" The search for \" %@ \" failed." , @" Search Controller - Background search failed error reason" );
434
+ reason = [NSString stringWithFormat: reason, searchString];
435
+ NSError *error = [NSError pb_errorWithDescription: desc
436
+ failureReason: reason
437
+ underlyingError: taskError];
425
438
[historyController.windowController showErrorSheet: error];
426
439
return ;
427
440
}
You can’t perform that action at this time.
0 commit comments