directus icon indicating copy to clipboard operation
directus copied to clipboard

The Error on Reject feature does not work for roles other than the admin role.

Open aliuygur opened this issue 6 months ago • 2 comments

Describe the Bug

First of all, thank you for the "Error on Reject" feature — it's something we've been waiting for a long time.

However, we're experiencing two issues:

  1. Issue If one flow calls another flow, the "Error on Reject" feature doesn't work, and the system reports the flow as successfully completed.

Example:

Flow A is Webhook / Request URL.

Flow B calls Flow A. Flow A returns a 500 error, but Flow B still shows as successfully completed.

  1. Issue To work around this limitation, we wrote a custom script in Flow B that checks Flow A’s result and throws an error like throw new Error("Error Message"). While we thought this workaround was effective, we noticed that non-admin users receive a generic error message like "Unexpected Error Occurred", instead of the custom error message.

To Reproduce

🔁 Steps to Reproduce — Issue 1: "Error on Reject" doesn't propagate in nested flows Create Flow A that is triggered via a Webhook / Request URL.

Inside Flow A, intentionally cause an error (e.g., return a 500 status).

Create Flow B that calls Flow A using a "Call Flow" or similar action.

Trigger Flow B.

Observe the result: → Despite Flow A returning an error, Flow B completes successfully without triggering the "Error on Reject" behavior.

🔁 Steps to Reproduce — Issue 2: Custom error message not shown to non-admin users

  1. Create a Flow
  2. Add a "Custom Script" operation to the Flow
  3. In the "Custom Script" operation, write a script that throws an error, for example:
    module.exports = async function(data) {
     throw new Error("This is a custom error message");
    

}



Observe the result:
→ Instead of showing the custom error message (This is a custom error message), the user sees a generic message such as "Unexpected Error Occurred".

### Directus Version

v11.8.0

### Hosting Strategy

Self-Hosted (Docker Image)

### Database

postgresql 16

aliuygur avatar Jun 02 '25 16:06 aliuygur

No dupes found!

triagster[bot] avatar Jun 02 '25 16:06 triagster[bot]

I am unable to reproduce the first reported issue, flow_b correctly returns a failed status when flow_a rejects.

https://github.com/user-attachments/assets/305bf881-c72a-4461-b50f-f69238333d81

The second reported issue is a duplicate of https://github.com/directus/directus/issues/24849. I'll go ahead and close this, happy to continue discussing in this thread and we can reopen if a reproduction for issue 1 is found.

ComfortablyCoding avatar Jun 26 '25 16:06 ComfortablyCoding