@mega-yfue/eufy-sdk / SessionExpiredError
Class: SessionExpiredError
Thrown when a persisted/expired session is rejected (401). Re-login to recover.
It carries the rate the client has already worked out for replacing a rejected token, because the rejection is where that rate stops being the client's alone: a login driven from here spends the same session the client's own recovery would have, and repeated logins are what makes an account start demanding captchas. retryAfterMs is how long the next replacement is barred for, and contended whether this rejection landed inside that bar — the shape repeated displacement has.
Extends
Error
Constructors
Constructor
new SessionExpiredError(message, opts?): SessionExpiredError;Parameters
message
string
opts?
contended?
boolean
retryAfterMs?
number
Returns
SessionExpiredError
Overrides
Error.constructor
Properties
contended
readonly contended: boolean;Whether this rejection landed inside that bar — a token replaced recently and rejected again since.
That is the shape displacement by another client signed in on this account has, where replacing the token again only trades one login for another. It is not proof of one, since a cloud refusing to re-issue the session looks the same.
retryAfterMs
readonly retryAfterMs: number;How long the next session replacement is barred for, in milliseconds; 0 when nothing bars one now.
The remainder of the client's own hold-off, which doubles per consecutive replacement and is capped — and which every replacement extends, whether the client spent it or a login made on this error did.