Print a warning on unexpected internal errors.

The error message can be dropped when converting angle::Result to egl::Error.
This makes sure something is always printed when we get an unexpected error.

BUG=914911

Change-Id: Icc8b06b1c13e3ea83287da5a217f4c8bc218deec
Reviewed-on: https://chromium-review.googlesource.com/c/1378689
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 54a36fe..b24823f 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -8155,8 +8155,13 @@
     errorStream << "Error: " << gl::FmtHex(errorCode) << ", in " << file << ", " << function << ":"
                 << line << ". " << message;
 
+    std::string formattedMessage = errorStream.str();
+
+    // Always log a warning, this function is only called on unexpected internal errors.
+    WARN() << formattedMessage;
+
     // validationError does the necessary work to process the error.
-    validationError(errorCode, errorStream.str().c_str());
+    validationError(errorCode, formattedMessage.c_str());
 }
 
 void ErrorSet::validationError(GLenum errorCode, const char *message)