[web] improve error handling in queries tests
Summary:
Context in https://phab.comm.dev/D11175#inline-67962
Depends on D11175
Test Plan:
- Run tests
- Set dbModule to null and check if descriptive error is visible
Reviewers: marcin, michal
Reviewed By: marcin
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D11241