Changeset 4530 for exist


Ignore:
Timestamp:
04/12/08 09:47:11 (11 years ago)
Author:
cbyrom
Message:

Improve error handling when checking schema validation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/lib/atomvalidator.py

    r4512 r4530  
    1111 @author: C Byrom, Tessella Nov 2008 
    1212''' 
    13 import logging, traceback, datetime 
     13import logging, traceback, datetime, xmlrpclib, socket 
    1414import ndgUtils.models.existdbclient as edc 
    1515from ndgUtils.vocabtermdata import isValidTermURI 
     
    294294            # check for a meaningful error message 
    295295            error = e.message 
    296             if not error: 
     296            if isinstance(e, xmlrpclib.Fault): 
    297297                # strip out the exception type - NB, this is usually native library code 
    298298                # and is of no real interest - and will just confuse viewers 
    299299                error = e.faultString.split(':')[-1]  
     300            elif isinstance(e, socket.error): 
     301                error = e.args[1] 
    300302                 
    301303            errorMessage = "Problem experienced when validating against schema:%s'%s'" \ 
Note: See TracChangeset for help on using the changeset viewer.