At the moment most if not all of the exceptions are dealt with a simple try/except
try:
# code
except Exception:
# error message and cleanup
Maybe it would be better to create a wrapper over it (for instance a decorator on the codes of block called) which gives also better error messages (which we can extract from the e in except Exception as e:)
@catch_exception
block_that_should_not_fail()
Or at least catch the exception in some standard way for more complex cases:
try:
# code
except Exception as e:
exception_error_message(e, "Specific error message")
# -> "MustardUI Error - " + "Specific error message" + " : " + str(e)
# cleanup
At the moment most if not all of the exceptions are dealt with a simple try/except
Maybe it would be better to create a wrapper over it (for instance a decorator on the codes of block called) which gives also better error messages (which we can extract from the
einexcept Exception as e:)Or at least catch the exception in some standard way for more complex cases: