Commit 1099853e authored by Jimmy Gong's avatar Jimmy Gong Committed by Commit Bot

Capture more error states in print job history

- Fixes a bug where the PRINTER_UNREACHABLE error was not captured
  by the print job history service.
- This only occurred if the user were to attempt to print repeatedly
  to an offline printer. In those cases, the error was only captured
  in the OnPrintJobUpdated event.

Bug: 1103429
Change-Id: I910fa3a173300e62ac151e58ff679c0e389497ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315797Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Reviewed-by: default avatarNikita Podguzov <nikitapodguzov@chromium.org>
Reviewed-by: default avatarBailey Berro <baileyberro@chromium.org>
Commit-Queue: Jimmy Gong <jimmyxgong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795139}
parent 480004ff
......@@ -467,7 +467,7 @@ class CupsPrintJobManagerImpl : public CupsPrintJobManager,
NotifyJobDone(job);
break;
case State::STATE_ERROR:
NotifyJobUpdated(job);
NotifyJobFailed(job);
break;
}
}
......
......@@ -66,6 +66,7 @@ proto::PrintJobInfo_PrintJobSource PrintJobSourceToProto(
proto::PrintJobInfo_PrintJobStatus PrintJobStateToProto(
CupsPrintJob::State state) {
switch (state) {
case CupsPrintJob::State::STATE_ERROR:
case CupsPrintJob::State::STATE_FAILED:
return proto::PrintJobInfo_PrintJobStatus_FAILED;
case CupsPrintJob::State::STATE_CANCELLED:
......
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