IProovException.error constructor

IProovException.error(
  1. String error,
  2. String title,
  3. String? message
)

Implementation

factory IProovException.error(String error, String title, String? message) {
  switch (error) {
    case 'capture_already_active':
      return CaptureAlreadyActiveException(title);
    case 'network':
      return NetworkException(title, message);
    case 'camera_permission':
      return CameraPermissionException(title);
    case 'server':
      return ServerException(title, message);
    case 'listener_not_registered':
      return ListenerNotRegisteredException(title);
    case 'multi_window_unsupported':
      return MultiWindowUnsupportedException(title);
    case 'camera':
      return CameraException(title, message);
    case 'face_detector':
      return FaceDetectorException(title, message);
    case 'unsupported_device':
      return UnsupportedDeviceException(title);
    case 'invalid_options':
      return InvalidOptionsException(title);
    case 'user_timeout':
      return UserTimeoutException(title);
  }

  return UnexpectedErrorException(title, message);
}