parseError static method

TonConnectError parseError(
  1. Map<String, dynamic> payload
)

Implementation

static TonConnectError parseError(Map<String, dynamic> payload) {
  final message = payload['error']?['message'];
  var code = payload['error']?['code'];

  if (code == null || ConnectEventErrorCodes.values.contains(code)) {
    code = ConnectEventErrorCodes.unknownError;
  }
  return ConnectEventErrors.getError(code, message);
}