Skip to content

ocpddev/problem

Repository files navigation

problem

This module is designed to handle errors from Spring Security and other common errors. It provides unified error handling, similar to Zalando Problem.

Usage

⚠️ When importing AdviceTrait, be mindful. It has both servlet and reactive versions, so make sure you import the correct one. ⚠️

For general errors, use GeneralAdviceTrait.

@RestControllerAdvice
class WebExceptionHandler : ResponseEntityExceptionHandler(), GeneralAdviceTrait {
}

For Spring Security errors, use SecurityAdviceTrait.

@RestControllerAdvice
class WebExceptionHandler : ResponseEntityExceptionHandler(), SecurityAdviceTrait {
}

Also, they can both work together.

@RestControllerAdvice
class WebExceptionHandler : ResponseEntityExceptionHandler(), GeneralAdviceTrait, SecurityAdviceTrait {
}

License

problem is licensed under Apache License, Version 2.0.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages