Skip to content

Commit 819c403

Browse files
committed
throw if we can't set file attributes so the test fails faster and clearer
1 parent 1f89e28 commit 819c403

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-native-node-api-modules/src/node/path-utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function removeReadPermissions(p: string) {
2929
};
3030

3131
const result = fswin.setAttributesSync(p, attributes);
32-
if (!result) console.error('!!!!! can not set attributes to remove read permissions');
32+
if (!result) throw new Error("can not set attributes to remove read permissions");
3333
}
3434

3535
function restoreReadPermissions(p: string) {
@@ -46,7 +46,7 @@ function restoreReadPermissions(p: string) {
4646
};
4747

4848
const result = fswin.setAttributesSync(p, attributes);
49-
if (!result) console.error('!!!!! can not set attributes to restore read permissions');
49+
if (!result) throw new Error("can not set attributes to restore read permissions");
5050
}
5151

5252
describe("isNodeApiModule", () => {

0 commit comments

Comments
 (0)