Skip to content

Commit

Permalink
404 вместо 500 при кривой ссылке
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcom committed Oct 14, 2023
1 parent 8990441 commit a1e8939
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.*
import org.springframework.web.servlet.ModelAndView
import org.springframework.web.util.UriComponentsBuilder
import ru.org.linux.auth.{AccessViolationException, AuthUtil}
import ru.org.linux.section.SectionService
import ru.org.linux.section.{SectionNotFoundException, SectionService}
import ru.org.linux.site.Template
import ru.org.linux.user.*

Expand Down Expand Up @@ -215,7 +215,7 @@ class UserTopicListController(topicListService: TopicListService, userDao: UserD
(modelAndView, user)
}

@ExceptionHandler(Array(classOf[UserNotFoundException]))
@ExceptionHandler(Array(classOf[UserNotFoundException], classOf[SectionNotFoundException]))
@ResponseStatus(HttpStatus.NOT_FOUND)
def handleNotFoundException = new ModelAndView("errors/code404")
}

0 comments on commit a1e8939

Please sign in to comment.