[Solved] Error while throwing User defined exception using orElseThrow in java 8 [duplicate]


it should be a supplier:

.orElseThrow(() -> new UserNotFoundException("User doesnt exist in system"));

0

solved Error while throwing User defined exception using orElseThrow in java 8 [duplicate]