getSdkError static method

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

Implementation

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