Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CUPS and error dialogs



Hi Bob,

We're aware error handling needs to be improved. See my comments below about the current behavior:

On Mar 26, 2004, at 8:25 AM, Bob Sander-Cederlof wrote:

Okay, I answered my own question. I may not have all the details correct, so if you see an error, please let me know.

Printing from a cups filter or backend to stderr has special effects, as it is processed by CUPS and by the PrinterProxy application.

(A PrinterProxy is created by the system when a printer is installed. It is named the same as the printer, and placed in ~/Library/Printers/ This is the app that runs the print job, and it monitors stderr messages by polling.

cupsd runs the job; the proxy just monitors the cups printer and job objects.

If you open this application, either from the Printer Setup Utility or by task switching, you will see that any message printed to stderr will, after a few seconds, appear in the dialog box above the progress bar.

Two things happen to stderr messages: they are conditionally written to the cups error_log and are copied to a printer's "printer-state-message" attribute (see <http://127.0.0.1:631/spm.html#4_1_4>). The printer proxy polls for and displays the "printer-state-message."

If the message printed is of the form "ERROR: ...", the message is written to /var/cups/error_log. If several seconds pass before the job finishes or another message is printed, the same message but with "ERROR: " stripped off, will appear above the progress bar in the dialog box.

If the message printed is of the form "ERROR: recoverable: ...", the message is written to /var/cups/error_log, "ERROR: " If several seconds pass before the job finishes or another message is printed, the same message but with "ERROR: " stripped off, be picked up by the PrinterProxy. PrinterProxy will in turn strip off "recoverable: ", and the remainder of the message will be displayed in a sheet that drops down from the top of the dialog box. (If the PrinterProxy was not already opened, this will cause it to be opened.) The sheet gives options to Delete Job, Stop All Jobs, or Stop Job.

The proxy looks for printer-state-message prefixes of "recoverable:", "recovered:" and "fatal:". When it sees recoverable it displays the warning sheet as you note and recovered causes it to be removed. With "fatal:" it attempts to cancel the job but there is a problem here (see below). I believe the proxy must already be running to see any of these conditions, it's not automatically launched when they occur.

The proxy polls cupsd for the latest printer-state-message every few seconds. Unfortunately these recoverable and recovered messages can come and go in-between this polling interval causing the proxy to miss them. In cups 1.1.19rc1 Michael Sweet added printer-state-history to help deal with this but it was too late for us to change the the proxy for Panther. We're looking at fixing this in a software update. In the time being, adding a sleep delay after emitting one of these message may help.

It is supposed to be possible to write messages of the form "ERROR: fatal: ..." also. But when I tried that the dropdown sheet kept dropping down, sliding up, dropping down, sliding up, endlessly. I had to terminate the task to get it to stop.

Due to a bug "fatal" causes the behavior you observed. For this reason I'd recommend you don't use it.


Hope this helps.

Jim

Earlier this month there was a thread about CUPS and error dialogs, but it was dropped with no satisfactory answer. The problem is, a printer may have a paper jam or run out of paper during printing. somehow, the user must be notified. Some printers are successful in doing so, but some of us writng new drivers have not been able to figure out how to make this happen.
Printing to stderr does not do it, all that does is add a line to the cups error_log.
So what is the secret?

--
= Bob Sander-Cederlof <email@hidden>, <email@hidden>
= On the web at <http://bobsc5.home.comcast.net>
= Macromedia, 1500 N. Greenville, Suite 500, Richardson, TX 75081
= Phone: (972) 664-7260 FAX: (972) 680-0537
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.


References: 
 >CUPS and error dialogs (From: Bob Sander-Cederlof <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.