this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

improve lexgen error messages

+4 -4
+4 -4
lex/type_schema.go
··· 814 814 pf("\t\treturn json.Marshal(t.%s)\n\t}\n", vname) 815 815 } 816 816 817 - pf("\treturn nil, fmt.Errorf(\"cannot marshal empty enum\")\n}\n\n") 817 + pf("\treturn nil, fmt.Errorf(\"can not marshal empty union as JSON\")\n}\n\n") 818 818 return nil 819 819 } 820 820 ··· 845 845 if ts.Closed { 846 846 pf(` 847 847 default: 848 - return fmt.Errorf("closed enums must have a matching value") 848 + return fmt.Errorf("closed unions must match a listed schema") 849 849 `) 850 850 } else { 851 851 pf(` ··· 877 877 pf("\t\treturn t.%s.MarshalCBOR(w)\n\t}\n", vname) 878 878 } 879 879 880 - pf("\treturn fmt.Errorf(\"cannot cbor marshal empty enum\")\n}\n") 880 + pf("\treturn fmt.Errorf(\"can not marshal empty union as CBOR\")\n}\n") 881 881 return nil 882 882 } 883 883 ··· 902 902 if ts.Closed { 903 903 pf(` 904 904 default: 905 - return fmt.Errorf("closed enums must have a matching value") 905 + return fmt.Errorf("closed unions must match a listed schema") 906 906 `) 907 907 } else { 908 908 pf(`