File size: 603 Bytes
3bfa0fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export class ConflictError extends Error {
	constructor(
		public readonly entityId: string,
		public readonly currentVersion: number
	) {
		super(`Entity ${entityId} was modified (current version ${currentVersion})`);
		this.name = 'ConflictError';
	}
}

export class NotFoundError extends Error {
	constructor(public readonly entityId: string) {
		super(`Entity ${entityId} not found`);
		this.name = 'NotFoundError';
	}
}

export class ReadOnlyError extends Error {
	constructor() {
		super('The app is in read-only mode: another instance holds the writer lock');
		this.name = 'ReadOnlyError';
	}
}