Rename DeviceErrorCallback to ErrorCallback and add ErrorType arg
This same callback will be used for push/pop error scope.
Bug: dawn:153
Change-Id: I2771539e13f8a4e6a59f13c8082689d25ba44905
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10460
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
diff --git a/src/dawn_wire/client/ClientDoers.cpp b/src/dawn_wire/client/ClientDoers.cpp
index abaa41c..531d724 100644
--- a/src/dawn_wire/client/ClientDoers.cpp
+++ b/src/dawn_wire/client/ClientDoers.cpp
@@ -18,9 +18,18 @@
namespace dawn_wire { namespace client {
- bool Client::DoDeviceErrorCallback(const char* message) {
- DAWN_ASSERT(message != nullptr);
- mDevice->HandleError(message);
+ bool Client::DoDeviceErrorCallback(DawnErrorType errorType, const char* message) {
+ switch (errorType) {
+ case DAWN_ERROR_TYPE_NO_ERROR:
+ case DAWN_ERROR_TYPE_VALIDATION:
+ case DAWN_ERROR_TYPE_OUT_OF_MEMORY:
+ case DAWN_ERROR_TYPE_UNKNOWN:
+ case DAWN_ERROR_TYPE_DEVICE_LOST:
+ break;
+ default:
+ return false;
+ }
+ mDevice->HandleError(errorType, message);
return true;
}