I am following this spring.io tutorial. There is a function like this:
@RequestMapping(method = RequestMethod.GET)
Collection<Bookmark> readBookmarks(@PathVariable String userId) throws UserNotFoundException {
this.validateUser(userId);
List<BookmarkResource> bookmarkResourceList = bookmarkRepository.findByAccountUsername(userId).stream().map(BookmarkResource::new).collect(Collectors.toList()) ;
return this.bookmarkRepository.findByAccountUsername(userId);
}
Although I had thrown the UserNotFoundException at the function signature, it still has Unhandled Exception at the double colons. I don't know how to throw that exception.
Any help would be appreciated!