Did I find the right examples for you? yes no

All Samples(26)  |  Call(25)  |  Derive(0)  |  Import(1)
Logs error into log file and if possible into zope error log

        def logException(msg, context=None, logger=LOGGER):
    """Logs error into log file and if possible into zope error log"""
    logger.exception(msg)
    if context is not None:
        error_log = getattr(context, 'error_log', None)
        if error_log is not None:
            error_log.raising(sys.exc_info())
        


src/c/o/collective.braveportletsmanager-1.0.1/collective/braveportletsmanager/retriever.py   collective.braveportletsmanager(Download)
from plone.portlets import retriever as base
 
from .util import logException
 
 
                settings = IPortletAssignmentSettings(assignment)
            except Exception:
                logException(u'Error during retrieving assignment settings. '
                    'Context: "%s", Category: "%s", Key: "%s", Assignment '
                    'Class: "%s", Assignment ID: "%s"' % (
                        settings = IPortletAssignmentSettings(assignment)
                    except Exception:
                        logException(u'Error during retrieving assignment '
                            'settings. Context: "%s", Category: "%s", Key: '
                            '"%s", Assignment Class: "%s", Assignment ID: "%s"'

src/x/c/xcp-storage-managers-HEAD/drivers/blktap2.py   xcp-storage-managers(Download)
                    ret = op(self, *args)
                except (util.SMException, XenAPI.Failure), e:
                    util.logException("BLKTAP2:%s" % op)
                    msg = str(e)
                    if isinstance(e, util.CommandException):
                        raise
                except:
                    util.logException("BLKTAP2:%s" % op)
                    raise
            finally:
            return ret == "True"
        except:
            util.logException("BLKTAP2:call_pluginhandler")
            return False
 
                vm_label = vm_rec.get("name_label")
        except:
            util.logException("alert_no_cache")
 
        alert_obj = "SR"
                prt_tapdisk.shutdown()
            except:
                util.logException("shutting down parent tapdisk")
        else:
            util.SMlog("Parent tapdisk still in use: %s" % read_cache_path)

src/x/c/xcp-storage-managers-HEAD/drivers/LVHDSR.py   xcp-storage-managers(Download)
                vhdutil.revert(vdi.path, jFile)
            except util.CommandException:
                util.logException("VHD journal revert")
                vhdutil.check(vdi.path)
                util.SMlog("VHD revert failed but VHD ok: removing journal")
                self._prepareThin(True)
            except:
                util.logException("attach")
                raise xs_errors.XenError('LVMProvisionAttach')
 
                self._prepareThin(False)
            except:
                util.logException("_prepareThin")
                raise xs_errors.XenError('VDIUnavailable', opterr='deflate')
 
                        "vdi-type", self.vdi_type)
            except XenAPI.Failure:
                util.logException("LVHDVDI.attach")
 
        self.attached = True
 
        except (util.SMException, XenAPI.Failure), e:
            util.logException("LVHDVDI._snapshot")
            self._failClone(origUuid, jval, str(e))
        util.fistpoint.activate("LVHDRT_clone_vdi_before_remove_journal",self.sr.uuid)

src/x/c/xcp-storage-managers-HEAD/drivers/NFSSR.py   xcp-storage-managers(Download)
                        "storage-type", "nfs")
            except:
                util.logException("NFSSR:attach")
                pass
 
                self.sr.attach(sr_uuid)
        except:
            util.logException("NFSFileVDI.attach_from_config")
            raise xs_errors.XenError('SRUnavailable', \
                        opterr='Unable to attach from config')

src/x/c/xcp-storage-managers-HEAD/drivers/SRCommand.py   xcp-storage-managers(Download)
    def run(self, sr):
        try:
            return self._run_locked(sr)
        except (util.SMException, XenAPI.Failure), e:
            util.logException(self.cmd)
            raise xs_errors.XenError(excType, opterr=msg)
        except:
            util.logException(self.cmd)
            raise
 

src/x/c/xcp-storage-managers-HEAD/drivers/LVHDoISCSISR.py   xcp-storage-managers(Download)
                    self.session.xenapi.PBD.set_device_config(pbd, dconf)
            except:
                util.logException("LVHDoISCSISR.load")
        self.iscsi = self.iscsiSRs[0]
 
            return LVHDSR.LVHDVDI.attach(self, sr_uuid, vdi_uuid)
        except:
            util.logException("LVHDoISCSIVDI.attach_from_config")
            raise xs_errors.XenError('SRUnavailable', \
                        opterr='Unable to attach the heartbeat disk')

src/x/c/xcp-storage-managers-HEAD/drivers/lvhdutil.py   xcp-storage-managers(Download)
            print "Usage: %s fixrefcounts <sr_uuid>" % sys.argv[0]
    except:
        util.logException("setInnerNodeRefcounts")
 

src/x/c/xcp-storage-managers-HEAD/drivers/lvmcache.py   xcp-storage-managers(Download)
            ret = op(self, *args)
        except KeyError:
            util.logException("LVMCache")
            util.SMlog("%s(%s): %s" % (op, args, self.toString()))
            raise

src/x/c/xcp-storage-managers-HEAD/drivers/LVHDoHBASR.py   xcp-storage-managers(Download)
            return self.attach(sr_uuid, vdi_uuid)
        except:
            util.logException("LVHDoHBAVDI.attach_from_config")
            raise xs_errors.XenError('SRUnavailable', \
                        opterr='Unable to attach the heartbeat disk')

src/x/c/xcp-storage-managers-HEAD/drivers/EXTSR.py   xcp-storage-managers(Download)
                    "storage-type", "ext")
        except:
            util.logException("EXTSR:attach")
            pass
 

  1 | 2  Next