Ignore:
Timestamp:
Dec 20, 2011, 1:47:35 PM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
no-cups
Children:
cad7502
Parents:
f6c6897
git-author:
Jessica B. Hamrick <jhamrick@…> (12/20/11 13:47:35)
git-committer:
Jessica B. Hamrick <jhamrick@…> (12/20/11 13:47:35)
Message:

Fix some errors in server/, handle fatal errors better

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach/server/server.py

    rdc40fe9 r6effd50  
    4141        # is an IPP error, then we can get the error code from the
    4242        # exception itself.
    43         except IPPException:
     43        except ipp.errors.IPPException:
    4444            exctype, excval, exctb = sys.exc_info()
    4545            excval.update_response(response)
     
    4949        # as an internal server error
    5050        except Exception:
    51             response.operation_id = const.ErrorCodes.INTERNAL_ERROR
     51            response.operation_id = ipp.StatusCodes.INTERNAL_ERROR
    5252            logger.error(traceback.format_exc())
    5353
    5454        # Send the response across HTTP
    5555        logger.debug("Sending response: %s" % repr(response))
     56        try:
     57            binary = response.packed_value
     58        except:
     59            logger.fatal(traceback.format_exc())
     60            sys.exit(1)
     61           
    5662        self.send_response(200, "Gutenbach IPP Response")
    5763        self.send_header("Content-Type", "application/ipp")
    5864        self.send_header("Connection", "close")
    5965        self.end_headers()
    60         self.wfile.write(response.packed_value)
     66        self.wfile.write(binary)
Note: See TracChangeset for help on using the changeset viewer.