builtIn static method

RpcError builtIn(
  1. int errorCode, {
  2. String? data,
})

Creates an error object from the code, with an auto-populated message.

Implementation

static RpcError builtIn(int errorCode, {String? data}) {
  return RpcError(
    message: errorMessages[errorCode] ?? 'Unknown error',
    code: errorCode,
    data: data,
  );
}