Skip to content

Commit f476ea1

Browse files
authored
Add missing enum cases in ExecuTorchError.h (#12721)
1 parent cea9b23 commit f476ea1

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

extension/apple/ExecuTorch/Exported/ExecuTorchError.h

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,34 @@ FOUNDATION_EXPORT NSErrorDomain const ExecuTorchErrorDomain NS_SWIFT_NAME(ErrorD
1919
*/
2020
typedef NS_ERROR_ENUM(ExecuTorchErrorDomain, ExecuTorchErrorCode) {
2121
// System errors.
22-
ExecuTorchErrorCodeOk = 0,
23-
ExecuTorchErrorCodeInternal = 1,
24-
ExecuTorchErrorCodeInvalidState = 2,
25-
ExecuTorchErrorCodeEndOfMethod = 3,
22+
ExecuTorchErrorCodeOk = 0,
23+
ExecuTorchErrorCodeInternal = 1,
24+
ExecuTorchErrorCodeInvalidState = 2,
25+
ExecuTorchErrorCodeEndOfMethod = 3,
2626

2727
// Logical errors.
28-
ExecuTorchErrorCodeNotSupported = 16,
29-
ExecuTorchErrorCodeNotImplemented = 17,
30-
ExecuTorchErrorCodeInvalidArgument = 18,
31-
ExecuTorchErrorCodeInvalidType = 19,
32-
ExecuTorchErrorCodeOperatorMissing = 20,
28+
ExecuTorchErrorCodeNotSupported = 16,
29+
ExecuTorchErrorCodeNotImplemented = 17,
30+
ExecuTorchErrorCodeInvalidArgument = 18,
31+
ExecuTorchErrorCodeInvalidType = 19,
32+
ExecuTorchErrorCodeOperatorMissing = 20,
33+
34+
// Registration errors.
35+
ExecuTorchErrorCodeRegistrationExceedingMaxKernels = 21,
36+
ExecuTorchErrorCodeRegistrationAlreadyRegistered = 22,
3337

3438
// Resource errors.
35-
ExecuTorchErrorCodeNotFound = 32,
36-
ExecuTorchErrorCodeMemoryAllocationFailed = 33,
37-
ExecuTorchErrorCodeAccessFailed = 34,
38-
ExecuTorchErrorCodeInvalidProgram = 35,
39-
ExecuTorchErrorCodeInvalidExternalData = 36,
40-
ExecuTorchErrorCodeOutOfResources = 37,
39+
ExecuTorchErrorCodeNotFound = 32,
40+
ExecuTorchErrorCodeMemoryAllocationFailed = 33,
41+
ExecuTorchErrorCodeAccessFailed = 34,
42+
ExecuTorchErrorCodeInvalidProgram = 35,
43+
ExecuTorchErrorCodeInvalidExternalData = 36,
44+
ExecuTorchErrorCodeOutOfResources = 37,
4145

4246
// Delegate errors.
43-
ExecuTorchErrorCodeDelegateInvalidCompatibility = 48,
44-
ExecuTorchErrorCodeDelegateMemoryAllocationFailed = 49,
45-
ExecuTorchErrorCodeDelegateInvalidHandle = 50,
47+
ExecuTorchErrorCodeDelegateInvalidCompatibility = 48,
48+
ExecuTorchErrorCodeDelegateMemoryAllocationFailed = 49,
49+
ExecuTorchErrorCodeDelegateInvalidHandle = 50,
4650
} NS_SWIFT_NAME(ErrorCode);
4751

4852
/**

extension/apple/ExecuTorch/Exported/ExecuTorchError.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
return @"Invalid type";
3131
case ExecuTorchErrorCodeOperatorMissing:
3232
return @"Operator missing";
33+
case ExecuTorchErrorCodeRegistrationExceedingMaxKernels:
34+
return @"Exceeded maximum number of kernels";
35+
case ExecuTorchErrorCodeRegistrationAlreadyRegistered:
36+
return @"Kernel is already registered";
3337
case ExecuTorchErrorCodeNotFound:
3438
return @"Resource not found";
3539
case ExecuTorchErrorCodeMemoryAllocationFailed:

0 commit comments

Comments
 (0)