simon0-o commented on code in PR #2469:
URL: https://github.com/apache/thrift/pull/2469#discussion_r963213079
##########
lib/go/thrift/application_exception.go:
##########
@@ -59,9 +62,35 @@ type TApplicationException interface {
Write(ctx context.Context, oprot TProtocol) error
}
+type ValidationError struct {
+ message string
+ check string
+ fieldSymbol string
+}
+
+func (e *ValidationError) Check() string {
+ return e.check
+}
+
+func (e *ValidationError) Field() string {
+ if fs := strings.Split(e.fieldSymbol, "."); len(fs) > 1 {
Review Comment:
`fieldSymbol` indicates a string like 'BasicTest.Double1', which means that
the field is the 'Double1' in type 'BasicTest'. And similarly
'BasicTest.Map0.key' indicates that the field is the key of field 'Map0' in
type 'BasicTest'.
I also add a new method 'TypeName' to ValidationError to get the name of the
type.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]