Why the case?  I would just do:

```
% allowed_keys will throw, not return
ok = allowed_keys(ValidKeys, Ejson),
ej:valid(Constraints, Ejson).