Fix P4RuntimeClient not logging write errors

Change-Id: I07d9e3ecdc4bcd7178db2fe5356c984d8ae64d5b
diff --git a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/client/WriteRequestImpl.java b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/client/WriteRequestImpl.java
index 49f85a3..36befeb 100644
--- a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/client/WriteRequestImpl.java
+++ b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/client/WriteRequestImpl.java
@@ -200,7 +200,7 @@
                             // it means we have processed the response error
                             // details and a log message will be produced for
                             // each failed entity. No need to log the top level
-                            // SRE.
+                            // SRE. Otherwise, log a generic WRITE error.
                             client.handleRpcError(t, "WRITE");
                         }
                         future.complete(response);
diff --git a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/client/WriteResponseImpl.java b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/client/WriteResponseImpl.java
index 35ee132..3ce3251 100644
--- a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/client/WriteResponseImpl.java
+++ b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/client/WriteResponseImpl.java
@@ -238,7 +238,7 @@
                 return setFailAllAndBuild(throwable);
             }
             final StatusRuntimeException sre = (StatusRuntimeException) throwable;
-            if (!sre.getStatus().equals(Status.UNKNOWN)) {
+            if (sre.getStatus().getCode() != Status.Code.UNKNOWN) {
                 // Error trailers expected only if status is UNKNOWN.
                 return setFailAllAndBuild(throwable);
             }