Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asFilter() can lead to 500 errors #21

Open
xurei opened this issue Jul 1, 2019 · 0 comments
Open

asFilter() can lead to 500 errors #21

xurei opened this issue Jul 1, 2019 · 0 comments
Assignees

Comments

@xurei
Copy link
Owner

xurei commented Jul 1, 2019

In this scenario :

all({
    postFetch: and(
        asFilter(willThrow),
        doSomethingElse,
   ),
}),

asFilter will return an array of null, then execute doSomethingElse. If no null check is done (which is very likely), the server breaks and returns 500.

Right now the best solution is to wrap everything in asFilter :

all({
    postFetch: asFilter(and(
        willThrow,
        doSomethingElse,
   )),
}),

This problem needs to be addressed for better dev experience. At least with some error message.

@xurei xurei changed the title asFilter() can create 500 errors asFilter() can lead to 500 errors Jul 1, 2019
@xurei xurei self-assigned this Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant