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: report unrecoverable error from backend



With the caveat about the 5 second window for detecting printer-state changes ...

On Monday, February 24, 2003, at 04:16 PM, Eric Cole wrote:

How do you report an error to the user from a backend?

fprintf (stderr, "ERROR: fatal: your error text string\n");

or

fprintf (stderr, "WARNING: recoverable: your error text string\n");

It's a good idea to make sure messages from your backend aren't buffered, so call

setbuf(stderr, NULL);

early in your main() function.


The job is finished, in that there is no way for it to complete without modifying the input parameters, so the backend will return 0 to avoid stopping the queue. There is currently no way for the user to distinguish between a failed job and a successful job.

If your backend exits with a non-zero result, it should stop the queue. Combined with the error message above, that will tell the user that the job did not print successfully.


Print Center never displays any of the strings beginning with "ERROR: " that are written to stderr. Same goes for the "WARNING: " prefix. Is there a trick to having Print Center recognize the output?

For the few errors that are recoverable the job is left in the queue.

Thanks
Eric
_______________________________________________
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: 
 >report unrecoverable error from backend (From: Eric Cole <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.