getInternalError static method

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

Implementation

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