Skip to content

Distinguishing between data errors and user abort #112

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

Closed
marcoscaceres opened this issue Jul 8, 2019 · 3 comments · Fixed by #113
Closed

Distinguishing between data errors and user abort #112

marcoscaceres opened this issue Jul 8, 2019 · 3 comments · Fixed by #113

Comments

@marcoscaceres
Copy link
Member

The spec says:

Activate the chosen share target, convert data to a format suitable for ingestion into the target, and transmit the converted data to the target. If an error occurs starting the target or transmitting the data, reject p with an "AbortError" DOMException, and abort these steps.

We probably want a DataError error here, so a developer knows that it's not the user aborting, but something wrong with the data they are trying to pass.

@ewilligers
Copy link
Collaborator

If they pass types that don't match the IDL, the bindings layer will generate a type error.
If they pass a bad URL, or don't pass any of the members that the implementation recognizes (currently title, text, url, optionally files), the implementation generates a type error.

If they are passing more data than the implementation allows (e.g. too many files, or files too large, or forbidden MIME types or file extensions), the implementation might generate a NotAllowedError.

I don't see see other failures as being due to the user data.

@marcoscaceres
Copy link
Member Author

NotAllowedError seems good... I'll updated #113

@marcoscaceres
Copy link
Member Author

marcoscaceres commented Jul 8, 2019

Oh wait... NotAllowedError could be confused with "not triggered by user activation". Still unclear to me (with developer hat on 🤠) that my data was no good... even if it was valid at the WebIDL binding layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants