Skip to content

Commit 7cd0041

Browse files
committed
chore: update errors
1 parent ebe682b commit 7cd0041

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎packages/expo-resource-fetcher/src/ResourceFetcher.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,17 @@ import {
3232
BaseResourceFetcherClass,
3333
} from 'react-native-executorch';
3434

35-
if (typeof Directory !== 'function' || typeof File !== 'function') {
35+
if (
36+
typeof Directory !== 'function' ||
37+
typeof File !== 'function' ||
38+
typeof (File as unknown as { createDownloadTask?: unknown })
39+
.createDownloadTask !== 'function'
40+
) {
3641
throw new RnExecutorchError(
3742
RnExecutorchErrorCode.ResourceFetcherFileSystemApiUnavailable,
3843
"react-native-executorch-expo-resource-fetcher: the new 'expo-file-system' API " +
39-
"(Directory/File) is unavailable — you're likely on Expo SDK <54. Import from " +
40-
"'react-native-executorch-expo-resource-fetcher/legacy' instead."
44+
"(Directory/File.createDownloadTask) is unavailable — you're likely on Expo SDK <56. " +
45+
"Import from 'react-native-executorch-expo-resource-fetcher/legacy' instead."
4146
);
4247
}
4348
import { ResourceFetcherUtils, DownloadStatus } from './ResourceFetcherUtils';

‎packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ enum class RnExecutorchErrorCode : int32_t {
123123
/**
124124
* Thrown when the Expo resource fetcher entry point is incompatible with the
125125
* installed expo-file-system version. The default entry point requires the
126-
* new Directory/File API (Expo SDK 54+); use the `/legacy` entry point on
126+
* new Directory/File API (Expo SDK 56+); use the `/legacy` entry point on
127127
* older SDKs.
128128
*/
129129
ResourceFetcherFileSystemApiUnavailable = 188,

‎packages/react-native-executorch/src/errors/ErrorCodes.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export enum RnExecutorchErrorCode {
115115
*/
116116
ResourceFetcherPlatformNotSupported = 187,
117117
/**
118-
* Thrown when the Expo resource fetcher entry point is incompatible with the installed expo-file-system version. The default entry point requires the new Directory/File API (Expo SDK 54+); use the `/legacy` entry point on older SDKs.
118+
* Thrown when the Expo resource fetcher entry point is incompatible with the installed expo-file-system version. The default entry point requires the new Directory/File API (Expo SDK 56+); use the `/legacy` entry point on older SDKs.
119119
*/
120120
ResourceFetcherFileSystemApiUnavailable = 188,
121121
/**

‎scripts/errors.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export const errorDefinitions = {
126126
*/
127127
ResourceFetcherPlatformNotSupported: 0xbb,
128128
/**
129-
* Thrown when the Expo resource fetcher entry point is incompatible with the installed expo-file-system version. The default entry point requires the new Directory/File API (Expo SDK 54+); use the `/legacy` entry point on older SDKs.
129+
* Thrown when the Expo resource fetcher entry point is incompatible with the installed expo-file-system version. The default entry point requires the new Directory/File API (Expo SDK 56+); use the `/legacy` entry point on older SDKs.
130130
*/
131131
ResourceFetcherFileSystemApiUnavailable: 0xbc,
132132

0 commit comments

Comments
 (0)