Print the error message before calling BreakPoint()

When env variable `DAWN_DEBUG_BREAK_ON_ERROR` set, dawn will
print the error message to console before calling BreakPoint().

Bug: none
Change-Id: I3875ffd375bb648ad9c1fad7c53fc5a3ebf79364
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/144380
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Peng Huang <penghuang@chromium.org>
diff --git a/src/dawn/native/ErrorData.cpp b/src/dawn/native/ErrorData.cpp
index 290d281..f032acf 100644
--- a/src/dawn/native/ErrorData.cpp
+++ b/src/dawn/native/ErrorData.cpp
@@ -17,6 +17,7 @@
 #include <utility>
 
 #include "dawn/common/Assert.h"
+#include "dawn/common/Log.h"
 #include "dawn/common/SystemUtils.h"
 #include "dawn/native/Error.h"
 #include "dawn/native/ObjectBase.h"
@@ -34,6 +35,7 @@
 
     auto [var, present] = GetEnvironmentVar("DAWN_DEBUG_BREAK_ON_ERROR");
     if (present && !var.empty() && var != "0") {
+        ErrorLog() << error->GetMessage();
         BreakPoint();
     }
     return error;