Bug 1332795: raise appropriate error when invalid tenant id is passed