test onerror gets defined