Don't throw an error to detect extended onError, use ErrorEvent object.