And replace it with factory method which includes more context for error code assignment. PiperOrigin-RevId: 380624625