@mega-yfue/eufy-sdk / MegaApiError
Class: MegaApiError
A mega API call the server answered with a non-zero envelope code, carrying that code rather than only a message.
The retry/auth logic here already decides what to do by NUMBER (4416, 10000, 4404, 26084), so the number is the authoritative fact about which condition was hit. Formatting it into a message and throwing a bare Error left every caller that needs to tell one condition from another parsing this module's message format back apart — a decision that belongs to the layer that owns the wire, not to whoever reads it.
Extends
Error
Constructors
Constructor
new MegaApiError(
message,
code,
status
): MegaApiError;Parameters
message
string
code
number | undefined
The envelope's code, or undefined when the failure produced no envelope.
status
number | undefined
The HTTP status the envelope arrived with.
Returns
MegaApiError
Overrides
Error.constructorProperties
code
readonly code: number | undefined;The envelope's code, or undefined when the failure produced no envelope.
status
readonly status: number | undefined;The HTTP status the envelope arrived with.