mirror of
https://github.com/zoriya/flood.git
synced 2026-06-02 19:11:14 +00:00
server: tests: match EACCES code only
This commit is contained in:
@@ -5,13 +5,13 @@ import path from 'path';
|
||||
import config from '../../config';
|
||||
|
||||
export const accessDeniedError = () => {
|
||||
const error = new Error() as NodeJS.ErrnoException;
|
||||
const error = new Error('Permission denied') as NodeJS.ErrnoException;
|
||||
error.code = 'EACCES';
|
||||
return error;
|
||||
};
|
||||
|
||||
export const fileNotFoundError = () => {
|
||||
const error = new Error() as NodeJS.ErrnoException;
|
||||
const error = new Error('No such file or directory') as NodeJS.ErrnoException;
|
||||
error.code = 'ENOENT';
|
||||
return error;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user