pipeline: print policy result

This commit is contained in:
Alex Gleason 2024-04-23 01:29:18 -05:00
parent e5dd4c587c
commit a53a21ffcf
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 3 additions and 1 deletions

View File

@ -43,7 +43,9 @@ async function handleEvent(event: DittoEvent, signal: AbortSignal): Promise<void
await hydrateEvent(event, signal);
if (UserPolicy) {
const [_, _eventId, ok, reason] = await new UserPolicy().call(event, signal);
const result = await new UserPolicy().call(event, signal);
debug(JSON.stringify(result));
const [_, _eventId, ok, reason] = result;
if (!ok) {
const [prefix, ...rest] = reason.split(': ');
throw new RelayError(prefix, rest.join(': '));