Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findOne throws exception instead of returning null when resource not found #141

Closed
edwingustafson opened this issue Aug 30, 2017 · 1 comment
Assignees

Comments

@edwingustafson
Copy link
Contributor

findOne should return null when no document is found with the given id. https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/repository/CrudRepository.html#findOne-ID-

Instead it is throwing an exception:

java.lang.RuntimeException: findById exception
	at com.microsoft.azure.spring.data.documentdb.core.DocumentDbTemplate.findById(DocumentDbTemplate.java:117)
	at com.microsoft.azure.spring.data.documentdb.repository.support.SimpleDocumentDbRepository.findOne(SimpleDocumentDbRepository.java:64)
⋮
Caused by: com.microsoft.azure.documentdb.DocumentClientException: Message: {"Errors":["Resource Not Found"]}
@ZhijunZhao
Copy link
Contributor

@edwingustafson Thank you for reporting this issue. We're working on a fix for it.

@ZhijunZhao ZhijunZhao self-assigned this Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants