Question · NestJS course · Module 10: Data Validation

Custom Error Messages

How do you add a custom error message to the @IsString() decorator?

Answer options

  • @IsString().message('Tekst wymagany!')
  • @IsString(error: 'Tekst wymagany!')
  • @IsString({ message: 'Tekst wymagany!' })
  • @Message('Tekst wymagany!') @IsString()

You can check the correct answer by solving this task in the CodeWorlds game.