Throwing ArgumentError

Hi !
I don’t know how to format error messages.
Exercise : Dart/Nth Prime
My code :

class NthPrime {
  int prime(int n) {
    if (n < 1) {
      throw ArgumentError(
          'message', 'Invalid argument(s): There is no zeroth prime');
    }
    List<int> primes = [];
    int counter = 2;
    while (primes.length < n) {
      if (primes.any((p) => counter % p == 0)) {
        counter++;
      } else {
        primes.add(counter);
      }
    }
    return primes.last;
  }
}

did not pass the tests :

NthPrime there is no zeroth prime [E]                                                                                                                           
  Expected: throws <Instance of 'ArgumentError'> with `message`: 'Invalid argument(s): There is no zeroth prime'
    Actual: <Closure: () => int>
     Which: threw ArgumentError:<Invalid argument(s) (Invalid argument(s): There is no zeroth prime): message>

What is wrong ?

Try passing ArgumentError() one string, which will be interpreted as the message

Hello !
This is I tried at first :
throw ArgumentError ('Invalid argument(s): There is no zeroth prime');
But it did not work. I tried also :
throw 'Invalid argument(s): There is no zeroth prime' ;
I did use ArgumentError in other exercises and it worked well …

throw ArgumentError('There is no zeroth prime');

oh yes ! :man_facepalming:
thanks