You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While some errors are clearly fatal (e.g. when the permission to use the sensor is denied, there's no point in continuing to listen to it) some might just be transient (e.g. a reading took longer than usual and triggered a timeout error) and the situation might resolve by itself without further involvement (the error becomes more of a warning in that case).
I see two ways to look at this:
1. Make a distinction Between Fatal and Transient Errors
Split up DOMExceptions somewhere along the following lines:
Fatal Errors
_Fatal errors_ would:
reject an eventually unresolved start promise,
emit an error event,
stop the Sensor object, and
change the sensor's state to "error".
These would be considered as _fatal errors_:
NotAllowedError(The request is not allowed by the user agent or the platform in the current context.)
SecurityError(The operation is insecure.)
NotSupportedError(The operation is not supported.)
AbortError(The operation was aborted.)
Transient Errors
_Transient errors_ would only:
emit an error event.
and would:
not reject an eventually opened start promise,
not stop the Sensor object, which would stay "active", and
not change the sensor's state to "error".
The following would be _transient errors_:
TimeoutError(The operation timed out.)
OperationError(The operation failed for an operation-specific reason.)
NotReadableError(The I/O read operation failed.)
UnknownError(The operation failed for an unknown transient reason (e.g. out of memory).)
2. Consider all errors as fatal, surface non critical issues though dedicated events.
The idea here is to consider transient issues as noteworthy but not exceptional unless further operation of the sensor is compromised. While it's useful to make these issues bubble up, they shouldn't interfere with the rest of the program unless the API consumer specifically takes steps to do so. These issues would be surfaced through dedicated events, for example, a frequencydrop event could be emitted by the device when it started polling at a lower rate than requested because it of switching into a battery-saving mode.
So you'd basically have _Errors_ which would:
reject an eventually unresolved start promise,
emit an error event,
stop the Sensor object, and
change the sensor's state to "error".
And _dedicated events_ which would:
just be emitted as specific eventa (e.g. frequencydrop).
not reject an eventually opened start promise,
not stop the Sensor object, which would stay "active", and
not change the sensor's state to "error".
This seems like a more sane approach, it's easier to explain and can be built in separate stages more easily. Level 1 would only handle fatal errors, and a level 2 spec could add dedicated events as needed.
The text was updated successfully, but these errors were encountered:
While some errors are clearly fatal (e.g. when the permission to use the sensor is denied, there's no point in continuing to listen to it) some might just be transient (e.g. a reading took longer than usual and triggered a timeout error) and the situation might resolve by itself without further involvement (the error becomes more of a warning in that case).
I see two ways to look at this:
1. Make a distinction Between Fatal and Transient Errors
Split up DOMExceptions somewhere along the following lines:
Fatal Errors
_Fatal errors_ would:
error
event,Sensor
object, and"error"
.These would be considered as _fatal errors_:
NotAllowedError
(The request is not allowed by the user agent or the platform in the current context.)SecurityError
(The operation is insecure.)NotSupportedError
(The operation is not supported.)AbortError
(The operation was aborted.)Transient Errors
_Transient errors_ would only:
and would:
Sensor
object, which would stay"active"
, and"error"
.The following would be _transient errors_:
TimeoutError
(The operation timed out.)OperationError
(The operation failed for an operation-specific reason.)NotReadableError
(The I/O read operation failed.)UnknownError
(The operation failed for an unknown transient reason (e.g. out of memory).)2. Consider all errors as fatal, surface non critical issues though dedicated events.
The idea here is to consider transient issues as noteworthy but not exceptional unless further operation of the sensor is compromised. While it's useful to make these issues bubble up, they shouldn't interfere with the rest of the program unless the API consumer specifically takes steps to do so. These issues would be surfaced through dedicated events, for example, a
frequencydrop
event could be emitted by the device when it started polling at a lower rate than requested because it of switching into a battery-saving mode.So you'd basically have _Errors_ which would:
error
event,Sensor
object, and"error"
.And _dedicated events_ which would:
frequencydrop
).Sensor
object, which would stay"active"
, and"error"
.This seems like a more sane approach, it's easier to explain and can be built in separate stages more easily. Level 1 would only handle fatal errors, and a level 2 spec could add dedicated events as needed.
The text was updated successfully, but these errors were encountered: