fromInt static method
- int code
Returns the ErrorCode corresponding to the given integer code
.
Throws an ArgumentError if the code is invalid.
Implementation
static ErrorCode fromInt(int code) {
return ErrorCode.values.firstWhere(
(e) => e.code == code,
orElse: () => throw ArgumentError('Invalid error code: $code'),
);
}