Saves error information in a database.