Skip to content

Instantly share code, notes, and snippets.

@ViktorStiskala
Created March 31, 2016 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ViktorStiskala/bbb12255d8b7298d0273f2367cd99964 to your computer and use it in GitHub Desktop.
Save ViktorStiskala/bbb12255d8b7298d0273f2367cd99964 to your computer and use it in GitHub Desktop.
def note_error(self, *msg):
if self.strict:
raise PermError(*msg)
# if lax mode, note error and continue
if not self.perm_error:
try:
raise PermError(*msg)
except PermError as x:
# FIXME: keep a list of errors for even friendlier diagnostics.
self.perm_error = x
return self.perm_error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment