@@ -67,7 +67,7 @@ public ResponseEntity<Tutorial> createTutorial(@RequestBody Tutorial tutorial) {
67
67
.save (new Tutorial (tutorial .getTitle (), tutorial .getDescription (), false ));
68
68
return new ResponseEntity <>(_tutorial , HttpStatus .CREATED );
69
69
} catch (Exception e ) {
70
- return new ResponseEntity <>(null , HttpStatus .EXPECTATION_FAILED );
70
+ return new ResponseEntity <>(null , HttpStatus .INTERNAL_SERVER_ERROR );
71
71
}
72
72
}
73
73
@@ -92,7 +92,7 @@ public ResponseEntity<HttpStatus> deleteTutorial(@PathVariable("id") long id) {
92
92
tutorialRepository .deleteById (id );
93
93
return new ResponseEntity <>(HttpStatus .NO_CONTENT );
94
94
} catch (Exception e ) {
95
- return new ResponseEntity <>(HttpStatus .EXPECTATION_FAILED );
95
+ return new ResponseEntity <>(HttpStatus .INTERNAL_SERVER_ERROR );
96
96
}
97
97
}
98
98
@@ -102,7 +102,7 @@ public ResponseEntity<HttpStatus> deleteAllTutorials() {
102
102
tutorialRepository .deleteAll ();
103
103
return new ResponseEntity <>(HttpStatus .NO_CONTENT );
104
104
} catch (Exception e ) {
105
- return new ResponseEntity <>(HttpStatus .EXPECTATION_FAILED );
105
+ return new ResponseEntity <>(HttpStatus .INTERNAL_SERVER_ERROR );
106
106
}
107
107
108
108
}
@@ -117,7 +117,7 @@ public ResponseEntity<List<Tutorial>> findByPublished() {
117
117
}
118
118
return new ResponseEntity <>(tutorials , HttpStatus .OK );
119
119
} catch (Exception e ) {
120
- return new ResponseEntity <>(HttpStatus .EXPECTATION_FAILED );
120
+ return new ResponseEntity <>(HttpStatus .INTERNAL_SERVER_ERROR );
121
121
}
122
122
}
123
123
0 commit comments