Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions extension/apple/ExecuTorch/Exported/ExecuTorchError.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ NSString *ExecuTorchErrorDescription(ExecuTorchErrorCode code)
* @return An NSError with ExecuTorchErrorDomain, the specified code, and a localized description.
*/
FOUNDATION_EXPORT
NS_RETURNS_RETAINED
__attribute__((deprecated("This API is experimental.")))
NSError *ExecuTorchErrorWithCode(ExecuTorchErrorCode code)
NS_SWIFT_NAME(Error(code:));
Expand All @@ -75,6 +76,7 @@ NSError *ExecuTorchErrorWithCode(ExecuTorchErrorCode code)
* @return An NSError with ExecuTorchErrorDomain, the specified code, and a localized description.
*/
FOUNDATION_EXPORT
NS_RETURNS_RETAINED
__attribute__((deprecated("This API is experimental.")))
NSError *ExecuTorchErrorWithCodeAndDescription(ExecuTorchErrorCode code, NSString * __nullable description)
NS_SWIFT_NAME(Error(code:description:));
Expand Down
6 changes: 3 additions & 3 deletions extension/apple/ExecuTorch/Exported/ExecuTorchError.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
}

NSError *ExecuTorchErrorWithCodeAndDescription(ExecuTorchErrorCode code, NSString * __nullable description) {
return [NSError errorWithDomain:ExecuTorchErrorDomain
code:code
userInfo:@{
return [[NSError alloc] initWithDomain:ExecuTorchErrorDomain
code:code
userInfo:@{
NSLocalizedDescriptionKey:
description.length > 0
? [ExecuTorchErrorDescription(code) stringByAppendingFormat:@": %@", description]
Expand Down
Loading