throw appropriate exceptions in subset solution