Skip to content

Commit 1eb17df

Browse files
committed
feat: show actual error message for iOS file read failures
Improved error handling in iOS platform by including the original error message when a podspec file cannot be read. In the event of a read failure, the thrown error now shows the underlying issue. Related-Task: INTER-1190
1 parent d417bf6 commit 1eb17df

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/platforms/iOS.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const resolve = async (
4444
case 'EACCES':
4545
throw new Error(`${podSpecJsonPath} file cannot be accessed.`)
4646
default:
47-
throw new Error(`${podSpecJsonPath} file cannot be read.`)
47+
throw new Error(`${podSpecJsonPath} file cannot be read. Error: ${error.message}`)
4848
}
4949
}
5050

test/__snapshots__/iOS.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ exports[`Test for iOS platform throws error when file not found: podspecFileNotF
44

55
exports[`Test for iOS platform throws error when file not readable: podspecNotReadable 1`] = `"not-readable.podspec.json file cannot be accessed."`;
66

7-
exports[`Test for iOS platform throws error when path is a directory: podspecPathIsDirectory 1`] = `"test file cannot be read."`;
7+
exports[`Test for iOS platform throws error when path is a directory: podspecPathIsDirectory 1`] = `"test file cannot be read. Error: EISDIR: illegal operation on a directory, read"`;

0 commit comments

Comments
 (0)