swap NOT_IMPLEMENTED for NOT_REACHED where appropriate#765
swap NOT_IMPLEMENTED for NOT_REACHED where appropriate#765mattklein123 merged 1 commit intomasterfrom
Conversation
|
@lyft/network-team |
|
You could move the Also, is there any reason why |
|
I think the idea is that the compiler was too dumb to figure out all cases had been covered, but I'm still surprised this is the case. I wonder if we're missing some flags. |
Yes, per @htuch the compiler is too stupid to realize that all cases are covered and the function will always return. It's better to not have a default in a switch statement if not necessary because the compiler will error that not all cases are covered. This is why I didn't add default.
It logs and then calls abort(). This is better than an exception because it guarantees immediate core dump where an exception might be caught. @PiotrSikora lmk if these explanations satisfy you. |
@mattklein123 That makes sense, thanks! |
**Commit Message** Previously, the controller didn't fallback to /v1 version for OpenAI schema since #706 which starts utilizing schema.version field. The field was previously non nil hence in many cases, it was set to empty, and that caused the backward incompatibility. This fixes it by defaulting to v1 when the field is set but empty string. **Related Issues/PRs (if applicable)** Follow up on #706 Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Fixes #590