3 O4\ @s^GdddeZGdddeZGdddeZGdddeZGdd d eZdd d Zd S)c@s0eZdZdZddZeddZeddZdS) InvalidDocumentExceptionzException raised when the given document is invalid and cannot be transformed. Attributes: message -- explanation of the error causes -- list of errors which caused this document to be invalid cCst||_dS)N)sorted_causes)selfcausesr/Users/sshvans/Documents/Work/Quickstart/python-virtual-environments/env/lib/python3.6/site-packages/samtranslator/model/exceptions.py__init__sz!InvalidDocumentException.__init__cCsdjt|jS)NzRInvalid Serverless Application Specification document. Number of errors found: {}.)formatlenr)rrrrmessage sz InvalidDocumentException.messagecCs|jS)N)r)rrrrrszInvalidDocumentException.causesN)__name__ __module__ __qualname____doc__rpropertyr rrrrrrs rc@s$eZdZdZddZeddZdS)DuplicateLogicalIdExceptionzException raised when a transformation adds a resource with a logical id which already exists. Attributes: message -- explanation of the error cCs||_||_||_dS)N) _logical_id _duplicate_id_type)r logical_id duplicate_idtyperrrrsz$DuplicateLogicalIdException.__init__cCsdj|j|j|jdS)NzTransforming resource with id [{logical_id}] attempts to create a new resource with id [{duplicate_id}] and type "{type}". A resource with that id already exists within this template. Please use a different id for that resource.)rrr)r rrr)rrrrr sz#DuplicateLogicalIdException.messageN)r r rrrrr rrrrrsrc@s$eZdZdZddZeddZdS)InvalidTemplateExceptionzxException raised when the template structure is invalid Attributes message -- explanation of the error cCs ||_dS)N)_message)rr rrrr.sz!InvalidTemplateException.__init__cCs dj|jS)Nz,Structure of the SAM template is invalid. {})r r)rrrrr 1sz InvalidTemplateException.messageN)r r rrrrr rrrrr'src@s,eZdZdZddZddZeddZdS) InvalidResourceExceptionznException raised when a resource is invalid. Attributes: message -- explanation of the error cCs||_||_dS)N)rr)rrr rrrr<sz!InvalidResourceException.__init__cCs |j|jkS)N)r)rotherrrr__lt__@szInvalidResourceException.__lt__cCsdj|j|jS)Nz$Resource with id [{}] is invalid. {})r rr)rrrrr Csz InvalidResourceException.messageN)r r rrrrrr rrrrr6src@s$eZdZdZddZeddZdS)InvalidEventExceptionzlException raised when an event is invalid. Attributes: message -- explanation of the error cCs||_||_dS)N) _event_idr)rZevent_idr rrrrNszInvalidEventException.__init__cCsdj|j|jS)Nz!Event with id [{}] is invalid. {})r rr)rrrrr RszInvalidEventException.messageN)r r rrrrr rrrrrHsr: cCs4|jpd|_|||jdf|jdd|_|S)aPrepends the first argument (i.e., the exception message) of the a BaseException with the provided message. Useful for reraising exceptions with additional information. :param BaseException exception: the exception to prepend :param str message: the message to prepend :param str end: the separator to add to the end of the provided message :returns: the exception N)r )args) exceptionr endrrrprependWs $r&N)r) Exceptionrrrrrr&rrrrs