MicrosoftEdge / MSEdgeExplainers

Home for explainer documents originated by the Microsoft Edge team
Creative Commons Attribution 4.0 International
1.29k stars 205 forks source link

[Web App Installation] The `exceptionVariable` should probably be a `DOMException` #655

Closed tomayac closed 1 year ago

tomayac commented 1 year ago

While it's not necessary, commonly the exceptionVariable of typical APIs (example) on the Web is a DOMException. This would align the API more with developer expectations

navigator.install('https://app.contoso.com')
.then(/* Redacted */)
.catch(error => {
  if (error.name === 'NotAllowedError') {
    /* The current `"disallowed" */
  } else if (error.name === 'OperationError') {
    /* The current `"not-installable"` */
  }
});

CC: @diekus

diekus commented 1 year ago

Hey @tomayac ! Indeed, this was actually pointed out to me internally by a colleague and I forgot to update it! We will make this a DOMException.

diekus commented 1 year ago

Hey @tomayac I've fixed this, this is now a DOMException. See the draft I am working on here: https://github.com/diekus/MSEdgeExplainers/blob/main/WebInstall/explainer.md