better handling of errors

* Throw specific errors instead of Exception.
* Better error reporting
minor: compact date format for export
print error message more conspicously in GUI
Updated example with closure