mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
pipeline: print policy result
This commit is contained in:
parent
e5dd4c587c
commit
a53a21ffcf
1 changed files with 3 additions and 1 deletions
|
|
@ -43,7 +43,9 @@ async function handleEvent(event: DittoEvent, signal: AbortSignal): Promise<void
|
||||||
await hydrateEvent(event, signal);
|
await hydrateEvent(event, signal);
|
||||||
|
|
||||||
if (UserPolicy) {
|
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) {
|
if (!ok) {
|
||||||
const [prefix, ...rest] = reason.split(': ');
|
const [prefix, ...rest] = reason.split(': ');
|
||||||
throw new RelayError(prefix, rest.join(': '));
|
throw new RelayError(prefix, rest.join(': '));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue