wip
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export class Game {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
@@ -9,11 +11,11 @@ export class Game {
|
||||
|
||||
static create(props: { id: string; name: string }): Game {
|
||||
if (!props.id || props.id.trim().length === 0) {
|
||||
throw new Error('Game ID is required');
|
||||
throw new RacingDomainValidationError('Game ID is required');
|
||||
}
|
||||
|
||||
if (!props.name || props.name.trim().length === 0) {
|
||||
throw new Error('Game name is required');
|
||||
throw new RacingDomainValidationError('Game name is required');
|
||||
}
|
||||
|
||||
return new Game({
|
||||
|
||||
Reference in New Issue
Block a user