mò Tã¸Ec@s&dZdklZlZd„Zdefd„ƒYZdeefd„ƒYZdefd„ƒYZ d efd „ƒYZ d e fd „ƒYZ d e fd„ƒYZ de fd„ƒYZ de fd„ƒYZdefd„ƒYZdefd„ƒYZdee fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZd!efd"„ƒYZd#efd$„ƒYZd%efd&„ƒYZd'efd(„ƒYZd)efd*„ƒYZd+efd,„ƒYZd-efd.„ƒYZd/efd0„ƒYZd1S(2sQZODB-defined exceptions $Id: POSException.py 40423 2005-11-30 06:29:00Z fdrake $(soid_reprsreadable_tid_reprcCs,|o d|pd}dt|ƒ|fS(Ns: %stsUndo error %s%s(treasontstoid_reprtoid(RRR((t0/data/zmath/zope/lib/python/ZODB/POSException.pyt _fmt_undostPOSErrorcBstZdZRS(sPersistent object system error.(t__name__t __module__t__doc__(((RRs t POSKeyErrorcBstZdZd„ZRS(sKey not found in database.cCst|idƒS(Ni(Rtselftargs(R ((Rt__str__s(RR R R(((RR s tTransactionErrorcBstZdZRS(s7An error occurred due to normal transaction processing.(RR R (((RR!s tTransactionFailedErrorcBstZdZRS(s|Cannot perform an operation on a transaction that previously failed. An attempt was made to commit a transaction, or to join a transaction, but this transaction previously raised an exception during an attempt to commit it. The transaction must be explicitly aborted, either by invoking abort() on the transaction, or begin() on its transaction manager. (RR R (((RR$s t ConflictErrorcBs\tZdZeeeeed„Zd„Zd„Zd„Zd„Zd„Z d„Z RS(sãTwo transactions tried to modify the same object at once. This transaction should be resubmitted. Instance attributes: oid : string the OID (8-byte packed string) of the object in conflict class_name : string the fully-qualified name of that object's class message : string a human-readable explanation of the error serials : (string, string) a pair of 8-byte packed strings; these are the serial numbers related to conflict. The first is the revision of object that is in conflict, the currently committed serial. The second is the revision the current transaction read when it started. data : string The database record that failed to commit, used to put the class name in the error message. The caller should pass either object or oid as a keyword argument, but not both of them. If object is passed, it should be a persistent object with an _p_oid attribute. cCsá|djo d|_n ||_|djod|_d|_n-|i|_|i}|i d|i |_|dj o$|idjpt ‚||_n|dj o$dk l}d||ƒ|_n||_dS(Nsdatabase conflict errort.(sget_pickle_metadatas%s.%s(tmessagetNoneR tobjectRt class_namet_p_oidt __class__tklassR RtAssertionErrortdatat ZODB.utilstget_pickle_metadatatserials(R RRRRRRR((Rt__init__Hs             cCsËg}|io|idt|iƒƒn|io|id|iƒn|ioA|i\}}|idt |ƒƒ|idt |ƒƒn|od|i di |ƒfSn|i SdS(Nsoid %ssclass %ssserial this txn started with %ssserial currently committed %ss%s (%s)s, ( textrasR RtappendRRRtcurrenttoldtreadable_tid_reprRtjoin(R R#R"R ((RRes   cCs|iS(N(R R(R ((Rtget_oidvscCs|iS(N(R R(R ((Rtget_class_nameyscCs |idS(Ni(R R(R ((Rtget_old_serial|scCs |idS(Ni(R R(R ((Rtget_new_serialscCs|iS(N(R R(R ((Rt get_serials‚s( RR R RRRR&R'R(R)R*(((RR.s      tReadConflictErrorcBs tZdZeeed„ZRS(s¦Conflict detected when object was loaded. An attempt was made to read an object that has changed in another transaction (eg. another thread or process). cCs:|djo d}nti|d|d|d|ƒdS(Nsdatabase read conflict errorRRR(RRRRR RR(R RRR((RR‹s  (RR R RR(((RR+…s tBTreesConflictErrorc BsVtZdZdddddddddddd d g Zd „Zd „Zd „ZRS(s.A special subclass for BTrees conflict errors.sConflicting bucket splitsConflicting changessConflicting delete and changesConflicting inserts or deletessConflicting deletessConflicting insertss)Conflicting deletes, or delete and changes#Empty bucket from deleting all keyss-Conflicting changes in an internal BTree nodesEmpty bucket in a transactioncCs(||_||_||_||_dS(N(tp1R tp2tp3R(R R-R.R/R((RRÃs   cCs d|i|i|i|ifS(Ns#BTreesConflictError(%d, %d, %d, %d)(R R-R.R/R(R ((Rt__repr__ÉscCs'd|i|i|i|i|ifS(Ns%BTrees conflict error at %d/%d/%d: %s(R R-R.R/tmsgsR(R ((RRÎs(RR R R1RR0R(((RR,‘s -/  tDanglingReferenceErrorcBs tZdZd„Zd„ZRS(sÅAn object has a persistent reference to a missing object. If an object is stored and it has a reference to another object that does not exist (for example, it was deleted by pack), this exception may be raised. Whether a storage supports this feature, it a quality of implementation issue. Instance attributes: referer: oid of the object being written missing: referenced oid that does not have a corresponding object cCs||_||_dS(N(tAoidR treferertBoidtmissing(R R3R5((RRßs cCs dt|iƒt|iƒfS(Ns from %s to %s(RR R4R6(R ((RRãs(RR R RR(((RR2Òs  t VersionErrorcBstZdZRS(s'An error in handling versions occurred.(RR R (((RR7çs tVersionCommitErrorcBstZdZRS(s@An invalid combination of versions was used in a version commit.(RR R (((RR8ês tVersionLockErrorcBstZdZRS(sModification to an object modified in an unsaved version. An attempt was made to modify an object that has been modified in an unsaved version. (RR R (((RR9ís t UndoErrorcBs#tZdZed„Zd„ZRS(s7An attempt was made to undo a non-undoable transaction.cCs||_||_dS(N(RR t_reasonRt_oid(R RR((RR÷s cCst|i|iƒS(N(RR R<R;(R ((RRûs(RR R RRR(((RR:ôs  tMultipleUndoErrorscBs tZdZd„Zd„ZRS(s9Several undo errors occurred during a single transaction.cCs!ti||dŒ||_dS(Ni(R:RR terrst_errs(R R>((RRscCs1dig}|iD]}|t|Œq~ƒS(Ns (R%t_[1]R R?tpairR(R R@RA((RRs(RR R RR(((RR=þs  t StorageErrorcBstZdZRS(s(Base class for storage based exceptions.(RR R (((RRB s tStorageTransactionErrorcBstZdZRS(s=An operation was invoked for an invalid transaction or state.(RR R (((RRC s tStorageSystemErrorcBstZdZRS(sPanic! Internal storage error!(RR R (((RRDs tMountedStorageErrorcBstZdZRS(s!Unable to access mounted storage.(RR R (((RREs t ReadOnlyErrorcBstZdZRS(s0Unable to modify objects in a read-only storage.(RR R (((RRFs tTransactionTooLargeErrorcBstZdZRS(s7The transaction exhausted some finite storage resource.(RR R (((RRGs t ExportErrorcBstZdZRS(s-An export file doesn't have the right format.(RR R (((RRHs t UnsupportedcBstZdZRS(s8A feature was used that is not supported by the storage.(RR R (((RRIs tInvalidObjectReferencecBstZdZRS(s,An object contains an invalid reference to another object. An invalid reference may be one of: o A reference to a wrapped persistent object. o A reference to an object in a different database connection. TODO: The exception ought to have a member that is the invalid object. (RR R (((RRJ!s tConnectionStateErrorcBstZdZRS(sXA Connection isn't in the required state for an operation. o An operation such as a load is attempted on a closed connection. o An attempt to close a connection is made while the connection is still joined to a transaction (for example, a transaction is in progress, with uncommitted modifications in the connection). (RR R (((RRK-s N(R RRR$Rt StandardErrorRtKeyErrorR RRRR+R,R2R7R8R9R:R=RBRCRDRERFRGRHRIRJRK(RDR$RGRRR=RR:RCRJRHR R8RFRER+R,R2RIR7RRRKR9RRB((Rt?s2  W A