getSdkError static method

WalletConnectError getSdkError(
  1. String key, {
  2. String context = '',
})

Implementation

static WalletConnectError getSdkError(
  String key, {
  String context = '',
}) {
  if (SDK_ERRORS.containsKey(key)) {
    return WalletConnectError(
      code: SDK_ERRORS[key]!['code']! as int,
      message: context != ''
          ? "${SDK_ERRORS[key]!['message']! as String} $context"
          : SDK_ERRORS[key]!['message']! as String,
    );
  }
  return const WalletConnectError(code: -1, message: 'UNKNOWN SDK ERROR');
}