You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Another case when Translate() panics is if there are no lenses defined:
panic: #Translate.out.steps._accum.1._lens: index out of range [0] with length 0:
/github.com/grafana/thema/translate.cue:104:31
That specific issue is similar to what I referenced #152 (though when I opened that issue I wasn't getting a panic, just silent failure - I'm not sure what was different but I'll include a repro if it comes up again)
yup, it's another invariant that needs checking. "Lens completeness" is its whole own invariant area. I'm guessing we'll be able to write checkers in stages. From where we are now, the following two checks are clearly necessary (but not sufficient):
In lenses, there must exist exactly one lens for each expected pair of version numbers
In each lens result, there must exist at least one "assignment" for every field in the to schema? (handwave handwave optional fields)
Translate()
does not currently return an error, but there are cases in which it may panic, so we should return an error when issues are encountered.thema/instance.go
Line 152 in e1d0481
The text was updated successfully, but these errors were encountered: