title: Kotlin Spring JPA Reactive overcoming the default exception
body: <p>I had a problem which was, 
  When have a unique constraint in the DB query,</p>
  
  <p>and then want to insert it again,
  I wanted to override the default exception.</p>
  
  <p>like when having a DB table like this</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS $ENROLLED_USERS_TABLE (
                      id INT AUTO_INCREMENT PRIMARY KEY,
                      $USERS_FIELD VARCHAR(250) NOT NULL UNIQUE
                  );
  </code></pre>
  
  <p>and the repo like this</p>
  
  <pre><code>@Repository
  interface UserRepository: ReactiveCrudRepository&lt;User, Int&gt;{
  
      @Modifying
      @Query("insert into $ENROLLED_USERS_TABLE ($USERS_FIELD) values (:user)")
      fun insertUser(@Param("user") user: String?): Mono&lt;Void?&gt;?
  }
  </code></pre>
  
  <p>this is my controller </p>
  
  <pre><code>@PostMapping("/{user}")
      suspend fun add(@PathVariable user:String): Void? = userRepository.insertUser(user)?.awaitFirstOrNull()
  </code></pre>
  
  <p>I have tried to put them in try and catch but it didn't work
  to catch the</p>
  
  <pre><code>@Service
  class UserService(val userRepository: UserRepository) {
  
      suspend fun add(user:String) {
          try {
              // some code
              userRepository.insertUser(user)?.onErrorReturn(throw ResourceAlreadyExists("User Already exists"))
  
          }
          catch (e: SQLException) {
              println("Custome Message")
          }
      }
  }
  </code></pre>
  
  <p>nothing worked I still get the exception that shows my database query :/</p>