Skip to content

Instantly share code, notes, and snippets.

@GHGHGHKO
Created February 23, 2023 13:02
Show Gist options
  • Select an option

  • Save GHGHGHKO/79d5e3a373b691e2ea7a4153cb269b50 to your computer and use it in GitHub Desktop.

Select an option

Save GHGHGHKO/79d5e3a373b691e2ea7a4153cb269b50 to your computer and use it in GitHub Desktop.
ExceptionAdvice accessDeniedException
@ExceptionHandler(value = [AccessDeniedException::class])
fun accessDeniedException(): ResponseEntity<CommonResult> {
return ResponseEntity
.status(HttpStatus.FORBIDDEN)
.body(responseService.failResult(
getMessage("accessDenied.code").toInt(),
getMessage("accessDenied.message")))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment