leopardStatusToException function

dynamic leopardStatusToException(
  1. String code,
  2. String? message
)

Implementation

leopardStatusToException(String code, String? message) {
  switch (code) {
    case 'LeopardException':
      return LeopardException(message);
    case 'LeopardMemoryException':
      return LeopardMemoryException(message);
    case 'LeopardIOException':
      return LeopardIOException(message);
    case 'LeopardInvalidArgumentException':
      return LeopardInvalidArgumentException(message);
    case 'LeopardStopIterationException':
      return LeopardStopIterationException(message);
    case 'LeopardKeyException':
      return LeopardKeyException(message);
    case 'LeopardInvalidStateException':
      return LeopardInvalidStateException(message);
    case 'LeopardRuntimeException':
      return LeopardRuntimeException(message);
    case 'LeopardActivationException':
      return LeopardActivationException(message);
    case 'LeopardActivationLimitException':
      return LeopardActivationLimitException(message);
    case 'LeopardActivationThrottledException':
      return LeopardActivationThrottledException(message);
    case 'LeopardActivationRefusedException':
      return LeopardActivationRefusedException(message);
    default:
      return LeopardException("unexpected code: $code, message: $message");
  }
}