createSBException function

SBException createSBException(
  1. String errorCode,
  2. String message
)

Implementation

SBException createSBException(String errorCode, String message) {
  final int code = int.tryParse(errorCode) ?? -1;

  switch (code) {
    case 1:
      return UnknownException(message);
    case 2:
      return InvalidLicenseException(message);
    case 3:
      return NullPointerException(message);
    case 4:
      return InvalidArgumentException(message);
    case 5:
      return InvalidImageRefException(message);
    case 6:
      return ComponentUnavailableException(message);
    case 7:
      return IllegalStateException(message);
    case 8:
      return IOException(message);
    case 9:
      return InvalidDataException(message);
    case 11:
      return OutOfMemoryException(message);
    case 12:
      return TimeoutException(message);
    default:
      if (code >= 100) {
        return ProcessException(message, code);
      }
      return UnknownException(message);
  }
}