File tree 3 files changed +6
-1
lines changed
3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,10 @@ module.exports = class APIError {
236
236
status : 422 ,
237
237
message : 'Directory is not empty.' ,
238
238
} ,
239
+ 'readdir_of_non_directory' : {
240
+ status : 422 ,
241
+ message : 'Readdir target must be a directory.' ,
242
+ } ,
239
243
240
244
// Write
241
245
'offset_without_existing_file' : {
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class HLReadDir extends HLFilesystemOperation {
38
38
if ( ! await svc_acl . check ( actor , subject , 'see' ) ) {
39
39
throw await svc_acl . get_safe_acl_error ( actor , subject , 'see' ) ;
40
40
}
41
- return [ await subject . getSafeEntry ( ) ] ;
41
+ throw APIError . create ( 'readdir_of_non_directory' ) ;
42
42
}
43
43
44
44
let children ;
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ class PosixError extends Error {
156
156
case 'missing_expected_metadata' : return new PosixError ( ErrorCodes . EINVAL , e . message ) ;
157
157
case 'overwrite_and_dedupe_exclusive' : return new PosixError ( ErrorCodes . EINVAL , e . message ) ;
158
158
case 'not_empty' : return new PosixError ( ErrorCodes . ENOTEMPTY , e . message ) ;
159
+ case 'readdir_of_non_directory' : return new PosixError ( ErrorCodes . ENOTDIR , e . message ) ;
159
160
160
161
// Write
161
162
case 'offset_without_existing_file' : return new PosixError ( ErrorCodes . ENOENT , e . message ) ;
You can’t perform that action at this time.
0 commit comments