Use toThrowdeveloperError instead of toThrow