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(
      code: SDK_ERRORS[key]!['code']! as int,
      message: context != ''
          ? "${SDK_ERRORS[key]!['message']! as String} $context"
          : SDK_ERRORS[key]!['message']! as String,
    );
  }
  return new Error(code: -1, message: "UNKNOWN SDK ERROR");
}