Updated Renderer::sync to return Error objects.

BUG=angle:520

Change-Id: I8f1f095977bab3848b9215cda1127a71982858b8
Reviewed-on: https://chromium-review.googlesource.com/220800
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index 8005b6e..defe06b 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -1526,7 +1526,12 @@
     gl::Context *context = gl::getNonLostContext();
     if (context)
     {
-        context->sync(true);
+        gl::Error error = context->sync(true);
+        if (error.isError())
+        {
+            context->recordError(error);
+            return;
+        }
     }
 }
 
@@ -1537,7 +1542,12 @@
     gl::Context *context = gl::getNonLostContext();
     if (context)
     {
-        context->sync(false);
+        gl::Error error = context->sync(false);
+        if (error.isError())
+        {
+            context->recordError(error);
+            return;
+        }
     }
 }