RnExecutorchErrorCode
Enum containing all error codes used throughout React Native ExecuTorch.Application-Level Errors (100-199)
UnknownError (101)
An umbrella-error that is thrown usually when something unexpected happens, for example a 3rd-party library error.ModuleNotLoaded (102)
Thrown when a user tries to run a model that is not yet downloaded or loaded into memory.- Calling model methods before
isReadyis true - Model download or loading failed
- Model was unloaded
FileWriteFailed (103)
An error occurred when saving a file. This could be, for instance a result image from an image model.ModelGenerating (104)
Thrown when a user tries to run a model that is currently processing. It is only allowed to run a single model prediction at a time.isGenerating before starting new operations.
LanguageNotSupported (105)
Thrown when a language is passed to a multi-language model that is not supported. For example OCR or Speech To Text.InvalidConfig (112)
Thrown when config parameters passed to a model are invalid. For example, when LLM’s topp is outside of range [0, 1].ThreadPoolError (113)
Thrown when React Native ExecuTorch threadpool problem occurs.FileReadFailed (114)
Thrown when a file read operation failed. This could be invalid image url passed to image models, or unsupported format.- Invalid file path or URI
- Unsupported image format
- Missing file permissions
- File does not exist
InvalidModelOutput (115)
Thrown when the size of model output is unexpected.WrongDimensions (116)
Thrown when the dimensions of input tensors don’t match the model’s expected dimensions.InvalidUserInput (117)
Thrown when the input passed to our APIs is invalid, for example when passing an empty message array to LLM’s generate().DownloadInterrupted (118)
Thrown when the number of downloaded files is unexpected, due to download interruptions.PlatformNotSupported (119)
Thrown when a feature or platform is not supported in the current environment.TokenizerError (167)
Thrown when an error occurs with the tokenizer or tokenization process.InvalidModelSource (255)
Thrown when the type of model source passed by the user is invalid.UnexpectedNumInputs (97)
Thrown when the number of passed inputs to the model is different than the model metadata specifies.Speech-to-Text Errors (160-169)
MultilingualConfiguration (160)
Thrown when there’s a configuration mismatch between multilingual and language settings in Speech-to-Text models.MissingDataChunk (161)
Thrown when streaming transcription is attempted but audio data chunk is missing.StreamingNotStarted (162)
Thrown when trying to stop or insert data into a stream that hasn’t been started.StreamingInProgress (163)
Thrown when trying to start a new streaming session while another is already in progress.Resource Fetcher Errors (180-189)
ResourceFetcherDownloadFailed (180)
Thrown when a resource fails to download. This could be due to invalid URL, or for example a network problem.- Network connectivity issues
- Invalid or unreachable URL
- Server errors (404, 500, etc.)
- Insufficient storage space
ResourceFetcherDownloadInProgress (181)
Thrown when a user tries to trigger a download that’s already in progress.ResourceFetcherAlreadyPaused (182)
Thrown when trying to pause a download that is already paused.ResourceFetcherAlreadyOngoing (183)
Thrown when trying to resume a download that is already ongoing.ResourceFetcherNotActive (184)
Thrown when trying to pause, resume, or cancel a download that is not active.ResourceFetcherMissingUri (185)
Thrown when required URI information is missing for a download operation.ResourceFetcherAdapterNotInitialized (186)
Thrown when trying to load resources without fetcher initialization.ExecuTorch Runtime Errors (0-50)
These errors originate from the underlying ExecuTorch runtime.Ok (0)
Status indicating a successful operation.Internal (1)
An internal error occurred.InvalidState (2)
Status indicating the executor is in an invalid state for a targeted operation.EndOfMethod (3)
Status indicating there are no more steps of execution to run.NotSupported (16)
Operation is not supported in the current context.NotImplemented (17)
Operation is not yet implemented.InvalidArgument (18)
User provided an invalid argument.InvalidType (19)
Object is an invalid type for the operation.OperatorMissing (20)
Operator(s) missing in the operator registry.NotFound (32)
Requested resource could not be found.MemoryAllocationFailed (33)
Could not allocate the requested memory.AccessFailed (34)
Could not access a resource.InvalidProgram (35)
Error caused by the contents of a program.InvalidExternalData (36)
Error caused by the contents of external data.OutOfResources (37)
Does not have enough resources to perform the requested operation.Delegate Errors (48-50)
DelegateInvalidCompatibility (48)
Init stage: Backend receives an incompatible delegate version.DelegateMemoryAllocationFailed (49)
Init stage: Backend fails to allocate memory.DelegateInvalidHandle (50)
Execute stage: The handle is invalid.Error Code Ranges
| Range | Category |
|---|---|
| 0-50 | ExecuTorch Runtime Errors |
| 97-119 | Application-Level Errors |
| 160-169 | Speech-to-Text Errors |
| 167 | Tokenizer Errors |
| 180-189 | Resource Fetcher Errors |
| 255 | Model Source Errors |