File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
extension/apple/ExecuTorch/Exported Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ NSString *ExecuTorchErrorDescription(ExecuTorchErrorCode code)
63
63
* @return An NSError with ExecuTorchErrorDomain, the specified code, and a localized description.
64
64
*/
65
65
FOUNDATION_EXPORT
66
+ NS_RETURNS_RETAINED
66
67
__attribute__ ((deprecated(" This API is experimental." )))
67
68
NSError *ExecuTorchErrorWithCode(ExecuTorchErrorCode code)
68
69
NS_SWIFT_NAME(Error(code:));
@@ -75,6 +76,7 @@ NSError *ExecuTorchErrorWithCode(ExecuTorchErrorCode code)
75
76
* @return An NSError with ExecuTorchErrorDomain, the specified code, and a localized description.
76
77
*/
77
78
FOUNDATION_EXPORT
79
+ NS_RETURNS_RETAINED
78
80
__attribute__ ((deprecated(" This API is experimental." )))
79
81
NSError *ExecuTorchErrorWithCodeAndDescription(ExecuTorchErrorCode code, NSString * __nullable description)
80
82
NS_SWIFT_NAME(Error(code:description:));
Original file line number Diff line number Diff line change 58
58
}
59
59
60
60
NSError *ExecuTorchErrorWithCodeAndDescription (ExecuTorchErrorCode code, NSString * __nullable description) {
61
- return [NSError errorWithDomain : ExecuTorchErrorDomain
62
- code: code
63
- userInfo: @{
61
+ return [[ NSError alloc ] initWithDomain : ExecuTorchErrorDomain
62
+ code: code
63
+ userInfo: @{
64
64
NSLocalizedDescriptionKey :
65
65
description.length > 0
66
66
? [ExecuTorchErrorDescription (code) stringByAppendingFormat: @" : %@ " , description]
You can’t perform that action at this time.
0 commit comments