示例#1
0
 def _alertException(*args, **kw):
     try:
         return func(*args, **kw)
     except root.Cancel:
         alert("Canceled.")
     except Exception, e:
         if ask("Error during {0}: {1!r}".format(func, e)[:1000], ["Report Error", "Okay"], default=1, cancel=0) == "Report Error":
             reportException(e)
示例#2
0
 def _alertException(*args, **kw):
     try:
         return func(*args, **kw)
     except root.Cancel:
         alert("Canceled.")
     except Exception, e:
         if ask("Error during {0}: {1!r}".format(func, e)[:1000],
                ["Report Error", "Okay"],
                default=1,
                cancel=0) == "Report Error":
             reportException(e)
示例#3
0
文件: mceutils.py 项目: DiEvAl/mcedit
 def _alertException(*args, **kw):
     try:
         return func(*args, **kw)
     except root.Cancel:
         alert("Canceled.")
     except pymclevel.infiniteworld.SessionLockLost as e:
         alert(e.message + "\n\nYour changes cannot be saved.")
         
     except Exception, e:
         logging.exception("Exception:")
         if ask("Error during {0}: {1!r}".format(func, e)[:1000], ["Report Error", "Okay"], default=1, cancel=0) == "Report Error":
             reportException()