Skip to content

Commit

Permalink
fix: replace incorrectly-used invalid target errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed May 23, 2021
1 parent b17fc26 commit adc429c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/service/script/common/ItemStep.ts
@@ -1,4 +1,5 @@
import { InvalidTargetError } from 'noicejs';
import { InvalidArgumentError } from '@apextoaster/js-utils';

import { ScriptContext, ScriptTarget } from '..';
import { isItem } from '../../../model/entity/Item';

Expand All @@ -9,6 +10,6 @@ export async function ItemStep(this: ScriptTarget, context: ScriptContext): Prom
}, 'step script');

if (!isItem(this)) {
throw new InvalidTargetError('target must be an item');
throw new InvalidArgumentError('target must be an item');
}
}
8 changes: 4 additions & 4 deletions src/util/state/FocusResolver.ts
@@ -1,5 +1,5 @@
import { mustExist } from '@apextoaster/js-utils';
import { BaseOptions, InvalidTargetError } from 'noicejs';
import { InvalidArgumentError, mustExist } from '@apextoaster/js-utils';
import { BaseOptions } from 'noicejs';

import { searchState } from '.';
import { WorldEntity } from '../../model/entity';
Expand Down Expand Up @@ -56,7 +56,7 @@ export class StateFocusResolver implements ScriptFocus {

await this.onActor(actor);
} else {
throw new InvalidTargetError('unable to find actor ID in state');
throw new InvalidArgumentError('unable to find actor ID in state');
}
}

Expand All @@ -73,7 +73,7 @@ export class StateFocusResolver implements ScriptFocus {

await this.onRoom(room);
} else {
throw new InvalidTargetError('unable to find room ID in state');
throw new InvalidArgumentError('unable to find room ID in state');
}
}

Expand Down

0 comments on commit adc429c

Please sign in to comment.