SHOW:
|
|
- or go back to the newest paste.
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"} |
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 | - | {"status": 404,"code": 404,"message": "No such Quiz","developerMessage": "Quiz with id: 3 is not found on the Database","moreInfoUrl": "mailto:support@javarush.ru"} |
16 | + | |
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"} |