Skip to content

Commit

Permalink
Passing error string through to NSError
Browse files Browse the repository at this point in the history
  • Loading branch information
colincornaby committed Jun 24, 2024
1 parent 5d83030 commit b0ef218
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/Plasma/Apps/plClient/Mac-Cocoa/PLSPatcher.mm
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,15 @@ static la_ssize_t copy_data(struct archive *ar, struct archive *aw)
NSString* msgString = [NSString stringWithSTString:msg];

dispatch_async(dispatch_get_main_queue(), ^{
ST::string errorString = ST::string::from_wchar(NetErrorToString(result));
NSString* errorNSString = [NSString stringWithSTString:errorString];
[parent.delegate
patcherCompletedWithError:parent
error:[NSError errorWithDomain:@"PLSPatchErrors"
code:result
userInfo:@{
NSLocalizedFailureErrorKey : msgString
NSLocalizedFailureErrorKey : errorNSString,
NSLocalizedFailureReasonErrorKey: msgString
}]];
});
}
Expand Down

0 comments on commit b0ef218

Please sign in to comment.