Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add onerror NDEFReader event #432

Merged
merged 2 commits into from Nov 5, 2019
Merged

Add onerror NDEFReader event #432

merged 2 commits into from Nov 5, 2019

Conversation

@beaufortfrancois
Copy link
Collaborator

beaufortfrancois commented Nov 5, 2019

This PR adds back the onerror NDEFReader event. It is only fired when the NFC device in proximity range does not expose NDEF technology for reading or formatting when scan() has started.

FIX: #279


Preview | Diff

index.html Outdated Show resolved Hide resolved
@kenchris

This comment has been minimized.

Copy link
Contributor

kenchris commented Nov 5, 2019

Yes

@beaufortfrancois

This comment has been minimized.

Copy link
Collaborator Author

beaufortfrancois commented Nov 5, 2019

@kenchris Feedback addressed.
@zolkis Feel free to merge if you approve.

@zolkis
zolkis approved these changes Nov 5, 2019
@zolkis zolkis merged commit 0fe24bf into w3c:gh-pages Nov 5, 2019
@reillyeon

This comment has been minimized.

Copy link

reillyeon commented Nov 6, 2019

Nack, this is exactly what I warned against in my comment on #391. We should carefully consider before having two mechanisms for reporting errors.

I can see a way to keep this error but we should make sure there are examples demonstrating how we expect developers to catch both kinds of errors.

@beaufortfrancois

This comment has been minimized.

Copy link
Collaborator Author

beaufortfrancois commented Nov 6, 2019

scan will reject only if scanning cannot be started (invalid options, hardware not available, permission denied, etc.)
onerror will be fired only if there are errors happening during an already started scan (not formatted tag, context lost)

@reillyeon

This comment has been minimized.

Copy link

reillyeon commented Nov 6, 2019

Can you update the examples to include a handler for the error event?

@beaufortfrancois

This comment has been minimized.

Copy link
Collaborator Author

beaufortfrancois commented Nov 6, 2019

Good idea! I'll do that tomorrow.

@beaufortfrancois beaufortfrancois deleted the beaufortfrancois:onerror branch Nov 6, 2019
@beaufortfrancois

This comment has been minimized.

Copy link
Collaborator Author

beaufortfrancois commented Nov 7, 2019

@reillyeon Here it is: #439

chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this pull request Nov 11, 2019
Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this pull request Nov 13, 2019
Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this pull request Nov 20, 2019
Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this pull request Nov 20, 2019
Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899586
Commit-Queue: Leon Han <leon.han@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716904}
aarongable pushed a commit to chromium/chromium that referenced this pull request Nov 20, 2019
Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899586
Commit-Queue: Leon Han <leon.han@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716904}
chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this pull request Nov 20, 2019
Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899586
Commit-Queue: Leon Han <leon.han@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716904}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 29, 2019
… Promise, a=testonly

Automatic update from web-platform-tests
[webnfc] Make NDEFReader#scan() return a Promise

Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899586
Commit-Queue: Leon Han <leon.han@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716904}

--

wpt-commits: 581a056bf7a743722a2e83cb80e1a8ce250e4f9d
wpt-pr: 20193
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request Nov 29, 2019
… Promise, a=testonly

Automatic update from web-platform-tests
[webnfc] Make NDEFReader#scan() return a Promise

Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899586
Commit-Queue: Leon Han <leon.han@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716904}

--

wpt-commits: 581a056bf7a743722a2e83cb80e1a8ce250e4f9d
wpt-pr: 20193
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Nov 30, 2019
… Promise, a=testonly

Automatic update from web-platform-tests
[webnfc] Make NDEFReader#scan() return a Promise

Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899586
Commit-Queue: Leon Han <leon.hanintel.com>
Reviewed-by: Reilly Grant <reillygchromium.org>
Cr-Commit-Position: refs/heads/master{#716904}

--

wpt-commits: 581a056bf7a743722a2e83cb80e1a8ce250e4f9d
wpt-pr: 20193

UltraBlame original commit: ee74abc564ce6cf1fc427217df061c04e5a43c83
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Nov 30, 2019
… Promise, a=testonly

Automatic update from web-platform-tests
[webnfc] Make NDEFReader#scan() return a Promise

Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899586
Commit-Queue: Leon Han <leon.hanintel.com>
Reviewed-by: Reilly Grant <reillygchromium.org>
Cr-Commit-Position: refs/heads/master{#716904}

--

wpt-commits: 581a056bf7a743722a2e83cb80e1a8ce250e4f9d
wpt-pr: 20193

UltraBlame original commit: ee74abc564ce6cf1fc427217df061c04e5a43c83
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Nov 30, 2019
… Promise, a=testonly

Automatic update from web-platform-tests
[webnfc] Make NDEFReader#scan() return a Promise

Previously NDEFReader#scan() returns void and an NDEFErrorEvent will be
dispatched in case that the scan operation cannot be started
successfully.

This is not a well accepted pattern, and also to align with
NDEFWriter#push(), this CL makes NDEFReader#scan() return a Promise
instead.

Note that now NDEFErrorEvent is only used to notify Mojo disconnection,
a follow-up CL will remove it completely by using ErrorEvent instead.

The spec change:
w3c/web-nfc#398
w3c/web-nfc#432

BUG=520391

Change-Id: I1477258ab70f7e40da31ea8795d63125b6a13af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899586
Commit-Queue: Leon Han <leon.hanintel.com>
Reviewed-by: Reilly Grant <reillygchromium.org>
Cr-Commit-Position: refs/heads/master{#716904}

--

wpt-commits: 581a056bf7a743722a2e83cb80e1a8ce250e4f9d
wpt-pr: 20193

UltraBlame original commit: ee74abc564ce6cf1fc427217df061c04e5a43c83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.