Commit 11444117 authored by reillyg's avatar reillyg Committed by Commit bot

Log serial read and write errors on Windows.

Log platform errors so that it is possible to determine from logs what
caused the chrome.serial API to return the generic "system_error"
message.

Review URL: https://codereview.chromium.org/1147223002

Cr-Commit-Position: refs/heads/master@{#330870}
parent 2338a2e9
......@@ -211,6 +211,7 @@ void SerialIoHandlerWin::WriteImpl() {
NULL,
&write_context_->overlapped);
if (!ok && GetLastError() != ERROR_IO_PENDING) {
VPLOG(1) << "Write failed";
QueueWriteCompleted(0, serial::SEND_ERROR_SYSTEM_ERROR);
}
}
......@@ -301,6 +302,7 @@ void SerialIoHandlerWin::OnIOCompleted(
NULL,
&read_context_->overlapped);
if (!ok && GetLastError() != ERROR_IO_PENDING) {
VPLOG(1) << "Read failed";
ReadCompleted(0, serial::RECEIVE_ERROR_SYSTEM_ERROR);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment