getInternalError static method

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

Implementation

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