-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return errors instead of panics when something goes wrong (#105)
* Return errors instead of panics when something goes wrong * Show field with error and update error messages * Update error msg * Update generator.go Co-authored-by: sam boyer <sdboyer@grafana.com> --------- Co-authored-by: sam boyer <sdboyer@grafana.com>
- Loading branch information
Showing
7 changed files
with
80 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- cue -- | ||
package test | ||
|
||
#Test: { | ||
#Type1: { | ||
group: string | ||
options?: [...string] | ||
} | ||
#Type2: { | ||
group: string | ||
details: { | ||
[string]: _ | ||
} | ||
} | ||
#UnionType: #Type1 | #Type2 | ||
union: #UnionType | ||
} @cuetsy(kind="interface") | ||
-- err -- | ||
Found an error in the field 'union:15:5'. Error: no handler for operator: '.' for kind 'struct' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters