getSdkError static method

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

Implementation

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