diff --git a/integ/rpc_test.go b/integ/rpc_test.go index ba52189..314f2ed 100644 --- a/integ/rpc_test.go +++ b/integ/rpc_test.go @@ -30,6 +30,11 @@ func TestRPCWorkflow(t *testing.T) { rpcErr, _ := err.(*iwf.ApiError) assert.Equal(t, "worker API error, status:501, errorType:test-error-type", rpcErr.Response.GetDetail()) + // Test unregister client + unregClient := iwf.NewUnregisteredClient(nil) + err = unregClient.InvokeRPCByName(context.Background(), wfId, "", "TestErrorRPC", 1, nil, nil) + assert.NotNil(t, err) + var rpcOutput int err = client.InvokeRPC(context.Background(), wfId, "", wf.TestRPC, 1, &rpcOutput) assert.Nil(t, err) diff --git a/iwf/errors.go b/iwf/errors.go index e201ae8..489e8c7 100644 --- a/iwf/errors.go +++ b/iwf/errors.go @@ -171,7 +171,7 @@ func IsWorkflowNotExistsError(err error) bool { func IsRPCError(err error) bool { apiError, ok := err.(*ApiError) - if !ok || apiError.Response == nil { + if !ok { return false } return apiError.StatusCode == 420