fishy commented on code in PR #2469:
URL: https://github.com/apache/thrift/pull/2469#discussion_r964934865
##########
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:
why not just return the whole string, `BasicTest.Map0.key`? now we have 2
separated APIs to return `BasicTest` and `Map0`, what about the `key` part?
this makes things unnecessarily complicated.
or just export the fields and remove the getters. we don't really need
getters here anyways, if someone really want to mutate the error returned, they
are on their own risks.
--
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]