lugu / qiloop

An implementation of QiMessaging in Go
MIT License
9 stars 1 forks source link

add more examples #24

Closed ng2dev closed 4 years ago

ng2dev commented 4 years ago

Learning about this cool library

ng2dev commented 4 years ago

Thanks for your review - I will work in your feedback by sunday.

ng2dev commented 4 years ago

Hey I went through most of your comments except for this error:

call say failed: ISerialization error Status Read Past End

it actually has nothing to do with that third party iferr package as this instance of the same error you mentioned above comes from this statement:

proxy_gen.go:1221

_, err = p.Call("say", buf.Bytes())
if err != nil {
    return fmt.Errorf("call say failed: %s", err)
}

could we use github.com/pkg/errors and replace all return fmt.Errorf statements generated or used in the library to eg:

_, err = p.Call("say", buf.Bytes())
    if err != nil {
            return errors.Wrap(err, "say failed")
    }

that way it is much easier and coherent to reason about where an error was thrown. With regards to the nature of the error I am at a loss what is happening but I encounter this error very frequently - usually I use to retry that call then but it is annoying.

lugu commented 4 years ago

Hey I went through most of your comments except for this error:

call say failed: ISerialization error Status Read Past End

it actually has nothing to do with that third party iferr package as this instance of the same error you mentioned above comes from this statement:

proxy_gen.go:1221

_, err = p.Call("say", buf.Bytes())
if err != nil {
  return fmt.Errorf("call say failed: %s", err)
}

could we use github.com/pkg/errors and replace all return fmt.Errorf statements generated or used in the library to eg:

_, err = p.Call("say", buf.Bytes())
    if err != nil {
            return errors.Wrap(err, "say failed")
    }

that way it is much easier and coherent to reason about where an error was thrown. With regards to the nature of the error I am at a loss what is happening but I encounter this error very frequently - usually I use to retry that call then but it is annoying.

You are 200% right: errors.Wrap should be used instead. I have created an issue for this: https://github.com/lugu/qiloop/issues/28

About the actual error:

ERRO[2019-11-29 23:10:30] call walkTo failed: ISerialization error Status Read Past End  caller="main.go:36" fName=main.main

i will create an issue if i reproduce it, fell free to do so as well.

Thanks a lot for all those examples !