File tree Expand file tree Collapse file tree
petshop/server/src/main/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,18 +46,18 @@ public void stop() {
4646
4747 private void exceptionHandler (ResponseException ex , Context ctx ) {
4848 ctx .status (ex .toHttpStatusCode ());
49- ctx .json (ex .toJson ());
49+ ctx .result (ex .toJson ());
5050 }
5151
5252 private void addPet (Context ctx ) throws ResponseException {
5353 Pet pet = new Gson ().fromJson (ctx .body (), Pet .class );
5454 pet = service .addPet (pet );
5555 webSocketHandler .makeNoise (pet .name (), pet .sound ());
56- ctx .json (new Gson ().toJson (pet ));
56+ ctx .result (new Gson ().toJson (pet ));
5757 }
5858
5959 private void listPets (Context ctx ) throws ResponseException {
60- ctx .json (service .listPets ().toString ());
60+ ctx .result (service .listPets ().toString ());
6161 }
6262
6363 private void deletePet (Context ctx ) throws ResponseException {
You can’t perform that action at this time.
0 commit comments