mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Add file based ResourceStore (#52)
* feat: Add file resource store * test: Write some tests for FileResourceStore * fix: Reformat code and fix various small things from reviews * fix: Change constants to just be the corresponding URL * fix: Remove extra unnecessary wrap in a Promise * fix: Write some more tests and fix related bugs * fix: Use old way to import fs promises to support older Node versions * refactor: Refactor code and tests * refactor: Refactor and better document code * fix: Change comparison with undefined by typeof check * fix: Invert typeof check
This commit is contained in:
9
src/util/errors/ConflictHttpError.ts
Normal file
9
src/util/errors/ConflictHttpError.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { HttpError } from './HttpError';
|
||||
/**
|
||||
* An error thrown when a request conflict with current state of the server.
|
||||
*/
|
||||
export class ConflictHttpError extends HttpError {
|
||||
public constructor(message?: string) {
|
||||
super(409, 'ConflictHttpError', message);
|
||||
}
|
||||
}
|
||||
9
src/util/errors/MethodNotAllowedHttpError.ts
Normal file
9
src/util/errors/MethodNotAllowedHttpError.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { HttpError } from './HttpError';
|
||||
/**
|
||||
* An error thrown when data was found for the requested identifier, but is not supported by the target resource.
|
||||
*/
|
||||
export class MethodNotAllowedHttpError extends HttpError {
|
||||
public constructor(message?: string) {
|
||||
super(405, 'MethodNotAllowedHttpError', message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user