Advertisement
Sydoruk1ua

Untitled

Jul 5th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. При таком коде
  2. Quiz quiz = quizRepository.findOne(id);
  3. if (quiz == null) throw new NoSuchQuizException(id);// must 404
  4. получаю
  5. {"status": 500,"code": 500,
  6. "message": "FBI is interested in your talents!",
  7. "developerMessage": "could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet",
  8. "moreInfoUrl": "mailto:support@javarush.ru"}
  9. А при таком
  10. Quiz quiz = null;
  11. try{
  12.     quiz = quizRepository.findOne(id);
  13. } catch (Exception ignore){
  14.    
  15. }
  16. if (quiz == null) throw new NoSuchQuizException(id);
  17. Все нормально получаю свой 404
  18.  
  19. {"status": 404,"code": 404,
  20. "message": "No such Quiz",
  21. "developerMessage": "Quiz with id: 3 is not found on the Database",
  22. "moreInfoUrl": "mailto:support@javarush.ru"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement