Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Removed Sync from error syscall names
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed May 3, 2024
1 parent 7c9d25f commit e387de6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/IsoFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class IsoFS extends Readonly(Sync(FileSystem)) {
public statSync(p: string): Stats {
const record = this._getDirectoryRecord(p);
if (!record) {
throw ApiError.With('ENOENT', p, 'statSync');
throw ApiError.With('ENOENT', p, 'stat');
}
return this._getStats(p, record)!;
}
Expand All @@ -105,7 +105,7 @@ export class IsoFS extends Readonly(Sync(FileSystem)) {

const record = this._getDirectoryRecord(path);
if (!record) {
throw ApiError.With('ENOENT', path, 'openFileSync');
throw ApiError.With('ENOENT', path, 'openFile');
}

if (record.isSymlink(this._data)) {
Expand All @@ -121,14 +121,14 @@ export class IsoFS extends Readonly(Sync(FileSystem)) {
// Check if it exists.
const record = this._getDirectoryRecord(path);
if (!record) {
throw ApiError.With('ENOENT', path, 'readdirSync');
throw ApiError.With('ENOENT', path, 'readdir');
}

if (record.isDirectory(this._data)) {
return record.getDirectory(this._data).fileList.slice(0);
}

throw ApiError.With('ENOTDIR', path, 'readdirSync');
throw ApiError.With('ENOTDIR', path, 'readdir');
}

private _getDirectoryRecord(path: string): DirectoryRecord | null {
Expand Down

0 comments on commit e387de6

Please sign in to comment.