Complete the following @ExceptionHandler method which handles PermissionDeniedException.
Java
@ExceptionHandler({1})
public ResponseEntity<Map<String, String>> handlePermissionDenied({2} e) {
Map<String, String> body = new HashMap<>();
body.put("message", e.getMessage());
body.put("status", {3});
return new ResponseEntity<>(body, {4});
}
Kotlin
@ExceptionHandler({1})
fun handlePermissionDenied(e: {2}): ResponseEntity<Map<String, String>> {
val body = HashMap<String, String?>()
body["message"] = e.getMessage()
body["status"] = {3}
return ResponseEntity(body, {4})
}