summaryrefslogtreecommitdiff
path: root/cups/ppd-cache.c
diff options
context:
space:
mode:
authorMichael Sweet <michael.r.sweet@gmail.com>2017-03-09 15:20:24 -0500
committerMichael Sweet <michael.r.sweet@gmail.com>2017-03-09 15:20:24 -0500
commita946858f0c166a35bd68c4ff84a9be560d27a256 (patch)
tree2b0351d902c18d50b63188a1983e9d1ce3a363ae /cups/ppd-cache.c
parent3ae6282d0e898df47efa334d2c97b3f7db181a3d (diff)
downloadcups-a946858f0c166a35bd68c4ff84a9be560d27a256.tar.gz
Add meaningful error messages to IPP Everywhere PPD generator (Issue #4954)
Diffstat (limited to 'cups/ppd-cache.c')
-rw-r--r--cups/ppd-cache.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
index 0ec877451..3c99f18bf 100644
--- a/cups/ppd-cache.c
+++ b/cups/ppd-cache.c
@@ -3147,15 +3147,27 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if (buffer)
*buffer = '\0';
- if (!buffer || bufsize < 1 || !response)
+ if (!buffer || bufsize < 1)
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
return (NULL);
+ }
+
+ if (!response)
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No IPP attributes."), 1);
+ return (NULL);
+ }
/*
* Open a temporary file for the PPD...
*/
if ((fp = cupsTempFile2(buffer, (int)bufsize)) == NULL)
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
return (NULL);
+ }
/*
* Standard stuff for PPD file...
@@ -4081,6 +4093,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
unlink(buffer);
*buffer = '\0';
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Printer does not support required IPP attributes or document formats."), 1);
+
return (NULL);
}