Skip to content

Commit a49b7b3

Browse files
authored
chore: misc code improvements (#1439)
1 parent 6852958 commit a49b7b3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/runtime/src/enhancements/policy/policy-utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -570,17 +570,13 @@ export class PolicyUtil extends QueryUtils {
570570
*/
571571
getCheckerConstraint(model: string, operation: PolicyCrudKind): ReturnType<CheckerFunc> | boolean {
572572
const checker = this.getModelChecker(model);
573-
if (!checker) {
574-
throw this.unknownError(`unable to load policy guard for ${model}`);
575-
}
576-
577573
const provider = checker[operation];
578574
if (typeof provider === 'boolean') {
579575
return provider;
580576
}
581577

582578
if (typeof provider !== 'function') {
583-
throw this.unknownError(`unable to load ${operation} checker for ${model}`);
579+
throw this.unknownError(`invalid ${operation} checker function for ${model}`);
584580
}
585581

586582
// call checker function

0 commit comments

Comments
 (0)