Skip to content

Commit 623ebf2

Browse files
committed
feat: 🎸 add NFS errors and cleanup encoder
1 parent 653788a commit 623ebf2

File tree

4 files changed

+142
-109
lines changed

4 files changed

+142
-109
lines changed

src/nfs/v3/Nfsv3Decoder.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {Reader} from '@jsonjoy.com/buffers/lib/Reader';
22
import {XdrDecoder} from '../../xdr/XdrDecoder';
33
import {Nfsv3FType, Nfsv3TimeHow, Nfsv3CreateMode, Nfsv3Proc} from './constants';
4+
import {Nfsv3DecodingError} from './errors';
45
import * as msg from './messages';
56
import * as structs from './structs';
67

@@ -74,7 +75,7 @@ export class Nfsv3Decoder {
7475
case Nfsv3Proc.COMMIT:
7576
return this.decodeCommitRequest();
7677
default:
77-
throw new Error(`Unknown procedure: \${proc}`);
78+
throw new Nfsv3DecodingError(`Unknown procedure: \${proc}`);
7879
}
7980
}
8081

@@ -123,7 +124,7 @@ export class Nfsv3Decoder {
123124
case Nfsv3Proc.COMMIT:
124125
return this.decodeCommitResponse();
125126
default:
126-
throw new Error(`Unknown procedure: \${proc}`);
127+
throw new Nfsv3DecodingError(`Unknown procedure: \${proc}`);
127128
}
128129
}
129130

0 commit comments

Comments
 (0)