added an 'error' object

so script always returns something and users don’t get broken graphics.