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