Advertisement
Sydoruk1ua

Untitled

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