January 2018
Intermediate to advanced
414 pages
10h 29m
English
We know how to handle errors, but sometimes we need to produce them. For example, let's try to create an error if we are trying to create a customer that is already created.
For this, we will create a simple Exception class, CustomerExistException:
package com.microservices.chapter4class CustomerExistException(override val message: String) : Exception(message)
Now we can modify the create method in our CustomerServiceImpl class to use this new exception:
package com.microservices.chapter4import com.microservices.chapter4.Customer.Telephoneimport org.springframework.stereotype.Componentimport reactor.core.publisher.Monoimport reactor.core.publisher.toFluximport reactor.core.publisher.toMonoimport java.util.concurrent.ConcurrentHashMap ...
Read now
Unlock full access