This is an automated email from the ASF dual-hosted git repository.

zike pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new c91a800d [fix][TableView] Correct argument order to Errorf in 
TableView message handling(#1130)
c91a800d is described below

commit c91a800d3ac7dee1f00f33641895dd2ebf418311
Author: Oliver Muir <ojcm...@gmail.com>
AuthorDate: Wed Nov 15 10:47:36 2023 +0000

    [fix][TableView] Correct argument order to Errorf in TableView message 
handling(#1130)
    
    ### Motivation
    When TableView fails to read a message with the schema the error message is 
malformed, e.g.
    ```
    ERRO[0000] msg.GetSchemaValue() failed with 
%!w(*pulsar.message=&{[..snipped..]}); msg is schema not found for topic: 
[..snipped..], schema version : [ [0 0 0 0 0 0 0 0] ]
    ```
    
    The correct formatting will help users to debug their issues.
    
    
    ### Modifications
    
    Switch error args to match the formatting directives and context of the 
message.
    
    Signed-off-by: Oliver Muir <oliver.muir@arenko.group>
    Co-authored-by: Oliver Muir <oliver.muir@arenko.group>
---
 pulsar/table_view_impl.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pulsar/table_view_impl.go b/pulsar/table_view_impl.go
index 85499f19..47f8c6c0 100644
--- a/pulsar/table_view_impl.go
+++ b/pulsar/table_view_impl.go
@@ -251,7 +251,7 @@ func (tv *TableViewImpl) handleMessage(msg Message) {
        } else {
                payload = 
reflect.Indirect(reflect.New(tv.options.SchemaValueType)).Interface()
                if err := msg.GetSchemaValue(&payload); err != nil {
-                       tv.logger.Errorf("msg.GetSchemaValue() failed with %w; 
msg is %v", msg, err)
+                       tv.logger.Errorf("msg.GetSchemaValue() failed with %w; 
msg is %v", err, msg)
                }
                tv.data[msg.Key()] = payload
        }

Reply via email to