Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- class MiExcepcion(Exception):
- pass
- try:
- raise MiExcepcion({"mensaje":"Mi Mensaje", "informacion":"Mi Informacion"})
- except MiExcepcion as e:
- detalles = e.args[0]
- print(detalles)
- print(detalles["mensaje"])
- print(detalles["informacion"])
- #{'mensaje': 'Este es el mensaje', 'informacion': 'Esto es la informacion'}
- # Mi Mensaje
- # Mi Informacion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement