Re: [web-nfc] Join NDEFReader and NDEFWriter (#601)

> Quick question: Is it clear for web developers that `onerror` will get fired only when scan has started.
> I can see why some web developers would think this code would work.
> 
> ```js
> const ndef = new NDEFReader();
> ndef.onerror = event => {
>   /* Was there an error while writing? */
> }
> ndef.write('hello world');
> ```

@beaufortfrancois 
I would like to have a clarification on your comment (it s me not understanding :) )

On the chromium implementation, there are 2 places where onerror is fired.
https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/nfc/ndef_reader.cc;l=217;drc=126a458910eb392beb0c56601c89233cd82d80b5

and

https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/nfc/nfc_proxy.cc;l=122;drc=126a458910eb392beb0c56601c89233cd82d80b5

which are 2 different cases, right?
So I think we need two different handling for those, since the first one is not really a readingerror?

-- 
GitHub Notification of comment by arskama
Please view or discuss this issue at https://github.com/w3c/web-nfc/pull/601#issuecomment-698909725 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 25 September 2020 12:50:35 UTC