Better error checking.
Better error checking.


Former-commit-id: 2e5e006898b98571c22812c41bb11a1247ee7f6e [formerly ccf46208275c0c4eeba697b4e0c1bb5bf1fca7e9] [formerly ccf46208275c0c4eeba697b4e0c1bb5bf1fca7e9 [formerly 110b87f4c835067e7118230e30809601f297e779]]
Former-commit-id: b31bbc64e330680582f54101591f222bc3585670
Former-commit-id: 593574493432b8ddfa0c95502dd1c941cb992c4d
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine