Skip to content

Commit 5dcaf4e

Browse files
committed
test: Apparently you can get FilesystemLoops
1 parent 232f3dd commit 5dcaf4e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/files/access.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assert, assertObjectMatch } from '@std/assert'
1+
import { assert, assertArrayIncludes, assertObjectMatch } from '@std/assert'
22
import { basename, dirname } from '@std/path'
33
import { BIDSFileDeno } from './deno.ts'
44

@@ -16,9 +16,9 @@ export function testAsyncFileAccess(
1616
} catch (e: any) {
1717
assertObjectMatch(e, {
1818
code: 'FILE_READ',
19-
subCode: 'NotFound',
2019
location: '/broken-symlink',
2120
})
21+
assertArrayIncludes(['NotFound', 'FilesystemLoop'], [e.subCode])
2222
}
2323
})
2424
await t.step('Insufficient permissions', async () => {

src/files/access.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { type Issue } from '../types/issues.ts'
44
function IOErrorToIssue(err: { code: string; name: string }): Issue {
55
const subcode = err.name
66
let issueMessage: string | undefined = undefined
7-
if (err.code === 'ENOENT') {
7+
if (err.code === 'ENOENT' || err.code === 'ELOOP') {
88
issueMessage = 'Possible dangling symbolic link'
99
}
1010
return { code: 'FILE_READ', subCode: err.name, issueMessage }

0 commit comments

Comments
 (0)