StreamErrorCode extension type

A strongly-typed wrapper around a Stream API error code.

The named constants cover the codes the API is known to send, across every Stream product — the registry is one shared space, so a chat and a video error draw from the same numbers. The type behaves like an int at runtime, so a code the SDK does not know yet still compares and prints as its number rather than failing to decode.

A code identifies the condition; the HTTP status it arrives with can vary, so neither is derivable from the other.

on
Implemented types
Available extensions

Constructors

StreamErrorCode(int code)
const

Properties

address → Pointer<Never>

Available on int, provided by the IntAddress extension

The memory address of the underlying data.
no setter
bitLength → int
Returns the minimum number of bits required to store this integer.
no setterinherited
code → int
final
hashCode → int
Returns a hash code for a numerical value.
no setterinherited
isApiKeyInvalid → bool

Available on StreamErrorCode, provided by the StreamErrorCodePredicates extension

Whether this code says the API key cannot be accepted (StreamErrorCode.apiKeyInvalid).
no setter
isEven → bool
Returns true if and only if this integer is even.
no setterinherited
isFinite → bool
Whether this number is finite.
no setterinherited
isInfinite → bool
Whether this number is positive infinity or negative infinity.
no setterinherited
isNaN → bool
Whether this number is a Not-a-Number value.
no setterinherited
isNegative → bool
Whether this number is negative.
no setterinherited
isOdd → bool
Returns true if and only if this integer is odd.
no setterinherited
isTokenExpired → bool

Available on StreamErrorCode, provided by the StreamErrorCodePredicates extension

Whether this code says the token has expired (StreamErrorCode.tokenExpired).
no setter
isTokenNotYetValid → bool

Available on StreamErrorCode, provided by the StreamErrorCodePredicates extension

Whether this code says the token is not valid yet (StreamErrorCode.tokenNotValidYet and StreamErrorCode.tokenUsedBeforeIssuedAt).
no setter
isTokenSignatureInvalid → bool

Available on StreamErrorCode, provided by the StreamErrorCodePredicates extension

Whether this code says the token's signature cannot be accepted (StreamErrorCode.tokenSignatureInvalid).
no setter
kilometers → Distance

Available on num, provided by the DistanceExtension extension

This value as a Distance in kilometers.
no setter
meters → Distance

Available on num, provided by the DistanceExtension extension

This value as a Distance in meters.
no setter
oneBitCount → int
The number of 1 bits in the binary representation of this integer.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sign → int
Returns the sign of this integer.
no setterinherited
toJS → JSNumber

Available on num, provided by the NumToJSExtension extension

Converts this num to a JSNumber.
no setter
trailingZeroBitCount → int
The number of trailing (least significant) zero bits in the binary representation of this integer.
no setterinherited

Methods

abs() → int
Returns the absolute value of this integer.
inherited
ceil() → int
Returns this.
inherited
ceilToDouble() → double
Returns this.toDouble().
inherited
clamp(num lowerLimit, num upperLimit) → num
Returns this num clamped to be in the range lowerLimit-upperLimit.
inherited
compareTo(num other) → int
Compares this to other.
inherited
floor() → int
Returns this.
inherited
floorToDouble() → double
Returns this.toDouble().
inherited
gcd(int other) → int
Returns the greatest common divisor of this integer and other.
inherited
modInverse(int modulus) → int
Returns the modular multiplicative inverse of this integer modulo modulus.
inherited
modPow(int exponent, int modulus) → int
Returns this integer to the power of exponent modulo modulus.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remainder(num other) → num
The remainder of the truncating division of this by other.
inherited
round() → int
Returns this.
inherited
roundToDouble() → double
Returns this.toDouble().
inherited
toDouble() → double
This number as a double.
inherited
toInt() → int
Truncates this num to an integer and returns the result as an int.
inherited
toRadixString(int radix) → String
Converts this int to a string representation in the given radix.
inherited
toSigned(int width) → int
Returns the least significant width bits of this integer, extending the highest retained bit to the sign. This is the same as truncating the value to fit in width bits using an signed 2-s complement representation. The returned value has the same bit value in all positions higher than width.
inherited
toString() → String
Returns a string representation of this integer.
inherited
toStringAsExponential([int? fractionDigits]) → String
An exponential string-representation of this number.
inherited
toStringAsFixed(int fractionDigits) → String
A decimal-point string-representation of this number.
inherited
toStringAsPrecision(int precision) → String
A string representation with precision significant digits.
inherited
toUnsigned(int width) → int
Returns the least significant width bits of this integer as a non-negative number (i.e. unsigned representation). The returned value has zeros in all bit positions higher than width.
inherited
truncate() → int
Returns this.
inherited
truncateToDouble() → double
Returns this.toDouble().
inherited

Operators

operator %(num other) → num
Euclidean modulo of this number by other.
inherited
operator &(int other) → int
Bit-wise and operator.
inherited
operator *(num other) → num
Multiplies this number by other.
inherited
operator +(num other) → num
Adds other to this number.
inherited
operator -(num other) → num
Subtracts other from this number.
inherited
operator /(num other) → double
Divides this number by other.
inherited
operator <(num other) → bool
Whether this number is numerically smaller than other.
inherited
operator <<(int shiftAmount) → int
Shift the bits of this integer to the left by shiftAmount.
inherited
operator <=(num other) → bool
Whether this number is numerically smaller than or equal to other.
inherited
operator ==(Object other) → bool
Test whether this value is numerically equal to other.
inherited
operator >(num other) → bool
Whether this number is numerically greater than other.
inherited
operator >=(num other) → bool
Whether this number is numerically greater than or equal to other.
inherited
operator >>(int shiftAmount) → int
Shift the bits of this integer to the right by shiftAmount.
inherited
operator >>>(int shiftAmount) → int
Bitwise unsigned right shift by shiftAmount bits.
inherited
operator ^(int other) → int
Bit-wise exclusive-or operator.
inherited
operator unary-() → int
Return the negative value of this integer.
inherited
operator |(int other) → int
Bit-wise or operator.
inherited
operator ~() → int
The bit-wise negate operator.
inherited
operator ~/(num other) → int
Truncating division operator.
inherited

Static Methods

fromJson(num code) → StreamErrorCode
Create a new instance from a json number.
toJson(StreamErrorCode code) → int
Serialize to json number.

Constants

acceptRejectCallIsGone → const StreamErrorCode
103 – The call being accepted or rejected is gone.
apiKeyInvalid → const StreamErrorCode
2 – The API key cannot be accepted: unknown, or the product it addresses is not enabled for the app.
appSuspended → const StreamErrorCode
99 – The app is suspended.
authenticationFailed → const StreamErrorCode
5 – Authentication failed for a reason other than the token codes below.
channelFeatureNotSupported → const StreamErrorCode
19 – The channel does not support this feature.
connectionIdNotFound → const StreamErrorCode
46 – The connection id is not known to the server.
cooldown → const StreamErrorCode
60 – The user must wait out the channel's cooldown before sending another message.
customCommandEndpointCallError → const StreamErrorCode
45 – Calling the custom command endpoint failed.
customCommandEndpointMissing → const StreamErrorCode
44 – The custom command has no endpoint configured.
duplicateUsername → const StreamErrorCode
6 – The username is already taken.
eventNotSupported → const StreamErrorCode
18 – The event type is not supported.
feedsStorageUnavailable → const StreamErrorCode
112 – Feeds storage is unavailable.
inputError → const StreamErrorCode
4 – The request could not be acted on as sent: input that failed validation, or a feature the app has not configured.
internalError → const StreamErrorCode
-1 – An unexpected server-side failure.
messageTooLong → const StreamErrorCode
20 – The message is longer than the allowed maximum.
moderationFailed → const StreamErrorCode
73 – Message moderation failed, or the moderation provider failed.
moderationOverloaded → const StreamErrorCode
111 – The moderation service is overloaded.
multipleNestingLevel → const StreamErrorCode
21 – Threads cannot be nested further.
notAllowed → const StreamErrorCode
17 – The caller lacks permission for this operation.
notFound → const StreamErrorCode
16 – The requested resource does not exist.
notSupportedInPushV1 → const StreamErrorCode
72 – The operation is not supported in push v1.
payloadTooBig → const StreamErrorCode
22 – The request payload is too big.
productSuspended → const StreamErrorCode
107 – The product is suspended for the app.
queryCallsPermissionsMismatch → const StreamErrorCode
102 – Calls matching the query were withheld because the user lacks access to them.
queryCallStatsPermissionsMismatch → const StreamErrorCode
104 – Call stats matching the query were withheld because the user lacks access to them.
queryChannelPermissionsMismatch → const StreamErrorCode
70 – Channels matching the query were withheld because the user lacks access to them.
rateLimited → const StreamErrorCode
9 – The request was rate limited.
requestCancelled → const StreamErrorCode
108 – The caller cancelled the request before the server finished.
requestTimeout → const StreamErrorCode
48 – The server timed the request out.
supportedInPushV3 → const StreamErrorCode
105 – The operation is supported only in push v3.
tokenExpired → const StreamErrorCode
40 – The token has expired, or has been revoked. Either way a fresh token fixes it.
tokenNotValidYet → const StreamErrorCode
41 – The token is not valid yet (its nbf claim is in the future). Waiting fixes it.
tokenSignatureInvalid → const StreamErrorCode
43 – The token's signature cannot be accepted. A configuration problem no token or wait fixes.
tokenUsedBeforeIssuedAt → const StreamErrorCode
42 – The token was used before it was issued (its iat claim is in the future). Waiting fixes it.
tooManyConnections → const StreamErrorCode
71 – The client has too many concurrent connections.
usersNotFound → const StreamErrorCode
113 – Some of the users named by the request do not exist.
videoCreateCallFailed → const StreamErrorCode
82 – Creating the call failed.
videoInvalidCallId → const StreamErrorCode
81 – The call id is not valid.
videoJoinCallFailure → const StreamErrorCode
101 – Joining the call failed.
videoJoinE2eeNotAvailable → const StreamErrorCode
110 – End-to-end encryption is not available for this call.
videoJoinMustRequestE2ee → const StreamErrorCode
109 – Joining this call requires requesting end-to-end encryption.
videoNoDatacentersAvailable → const StreamErrorCode
100 – No video datacenters are available.
videoProviderNotConfigured → const StreamErrorCode
80 – No video provider is configured.
videoRestrictedRegion → const StreamErrorCode
106 – The call is restricted in the caller's region.