Print code returns NS_OK in cases where it should return an error

RESOLVED FIXED

Status

()

RESOLVED FIXED
15 years ago
15 years ago

People

(Reporter: roland.mainz, Assigned: roland.mainz)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

15 years ago
Print code returns NS_OK in cases where it should return an error.
One of the (bad) examples is:
content/base/src/nsDocumentViewer.cpp
-- snip --
  // Check to see if this document is still busy
  // If it is busy and we aren't already "queued" up to print then
  // Indicate there is a print pending and cache the args for later
  PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
  if ((NS_FAILED(docShell->GetBusyFlags(&busyFlags)) ||
       (busyFlags != nsIDocShell::BUSY_FLAGS_NONE && busyFlags &
nsIDocShell::BUSY_FLAGS_PAGE_LOADING)) && 
      !mPrintDocIsFullyLoaded) {
    if (!mPrintIsPending) {
      mCachedPrintSettings           = aPrintSettings;
      mCachedPrintWebProgressListner = aWebProgressListener;
      mPrintIsPending                = PR_TRUE;
    }
    return NS_OK;
  }
-- snip --
IMHO this and other error codes should be more verbose (at least it took two
hours for me today to debug a print problem until I realised that the document
was still loading and couldn't be printed... and the print system returned
NS_OK... ;-( ).
(Assignee)

Comment 1

15 years ago
Taling myself...
Assignee: core.printing → roland.mainz
(Assignee)

Updated

15 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

15 years ago
Created attachment 141676 [details] [diff] [review]
Patch for 2004-02-17-trunk
(Assignee)

Comment 3

15 years ago
Comment on attachment 141676 [details] [diff] [review]
Patch for 2004-02-17-trunk

Requesting r=/sr= ...

Additionally to the original patch I addressed a bunch of other problems, too -
and added some PR_LOG() statements which should help to hunt some FireFox
issues with the print (error) dialog.
Attachment #141676 - Flags: superreview?(roc)
Attachment #141676 - Flags: review?(roc)
Comment on attachment 141676 [details] [diff] [review]
Patch for 2004-02-17-trunk

+NS_ERROR_GFX_PRINTER_DOC_IS_BUSY=The browser cannot print the document while
it is being loaded.

Add "Please wait for the document to finish loading and try again"
?

+NS_ERROR_GFX_PRINTING_NOT_IMPLEMENTED=Printing is not implemented.

Add "Please download another Mozilla build"
? Or maybe the xprint extension?

r+sr in any case
Attachment #141676 - Flags: superreview?(roc)
Attachment #141676 - Flags: superreview+
Attachment #141676 - Flags: review?(roc)
Attachment #141676 - Flags: review+
(Assignee)

Comment 5

15 years ago
(In reply to comment #4)
> (From update of attachment 141676 [details] [diff] [review])
> +NS_ERROR_GFX_PRINTER_DOC_IS_BUSY=The browser cannot print the document while
> it is being loaded.
> 
> Add "Please wait for the document to finish loading and try again"
> ?

No, the error may happen AFAIK for pages which are loading permanently (like
chat room pages) ... loading will never end for such pages... :)


> +NS_ERROR_GFX_PRINTING_NOT_IMPLEMENTED=Printing is not implemented.
> 
> Add "Please download another Mozilla build"
> ? Or maybe the xprint extension?

No, this has nothing todo with Xprint. Mozilla has a secret build flag to turn
all print support off - and in that case nothing can't be done (except loading
another build :) ... and normal printing has extra error codes (no printer
found, print module cannot be loaded, Xprint server not found) for all the cases
I am aware of (even "access to printer denied" to make Netware freaks happy :)).

> r+sr in any case

Thanks!

Comment 6

15 years ago
Checked in for gisburn.
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.