Update error.py

added an error log that creates a log file in event of an error