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: 5 seconds window for error.



On Saturday, May 31, 2003, at 06:52 PM, Sandman wrote:

Hi Paul,

I read about the 5 seconds window for error message. Here is what I am doing and I don't know if it is correct.

1. Unrecoverable error in BeginJob:
In BeginJob, if I fail to connect to the printer (which is possible for the printer I am working with), I want to display an error message in Print Center.

So I send my notification the Tioga way. Then I wait 5 seconds by doing sleep(5). But this doesn't work. I get an infinite loop going on. What I see in the cups log is the error showing up as Fatal, then I see a cancel coming from someone and I see the job restarting and this goes on infinitely until I manually stop the queue.

If you report a fatal error (kPMEventErrorOccurred) the user should see an error alert. If the user deletes the job or stops the queue, we call PrintJobMgr and in turn it calls the PM's CancelJob function. Other developers have reported problems with the reliability of this mechanism and it's being investigated. I have been unable to identify a reliable workaround for PMs.


Is there a mechanism in CUPS that will send a cancel to my PM when an unrecoverable error occur and if it hasn't quit yet?

Yes, having reported a fatal error, we call the PM's CancelJob function. Your PM has 15 seconds to clean up before we kill the PrintJobMgr process. It's not advisable to report another error event during this time.


If I don't sleep after sending my notification, I never get the dialog to show up in print center!

There is at least one known bug in Jaguar involving fatal errors. Once a fatal error has been reported, subsequent fatal errors can be ignored.


Is it safe to just wait 1 second then exit?

It depends what you mean by exit. Are you returning from your CancelJob function, or from PrintPage?


2. When I am printing, if an Unrecoverable happen, I use the Tioga notification mechanism, then I exit as soon as possible with a kPMGeneralError. Is this correct?

I don't recommend you do this. Having reported a fatal error, you should allow PrintJobMgr to call your PM's CancelJob function. BTW this happens on a separate thread. Your PM's main thread should wait for the abort flag to be set and then call EndJob.


Thanks,
pat
_______________________________________________
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.



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.