Skip to content

Commit 27aa955

Browse files
committed
Fix one missed case for 8b04bfe
1 parent d33bad2 commit 27aa955

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/authorization/policies/conditions/member.condition.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
eqlDoesIntersect,
1212
fqnRelativeTo,
1313
IsAllowedParams,
14+
MissingContextException,
1415
} from '../../policy/conditions';
1516

1617
const CQL_VAR = 'membershipRoles';
@@ -159,7 +160,9 @@ export const withScope = <T extends object>(obj: T, roles: ScopedRole[]) =>
159160

160161
export const getScope = (object?: HasScope): ScopedRole[] => {
161162
if (!object) {
162-
throw new Error("Needed object's scoped roles but object wasn't given");
163+
throw new MissingContextException(
164+
"Needed object's scoped roles but object wasn't given",
165+
);
163166
}
164167

165168
return Reflect.get(object, ScopedRoles) ?? Reflect.get(object, 'scope') ?? [];

0 commit comments

Comments
 (0)