title: Why I am not getting error message in postman using Spring Boot Application
body: <p>I want "Admin not found" message to display in Postman during invalid login but I am getting this
  as postman output</p>
  
  <pre><code>{
      "timestamp": "2020-05-19T13:59:01.172+00:00",
      "status": 404,
      "error": "Not Found",
      "message": "",
      "path": "/api/adminLogin"
  }
  </code></pre>
  
  <p><strong>AdminController.java</strong></p>
  
  <pre><code>    @RestController
      @RequestMapping("/api")
      public class AdminController {
  
      @Autowired
      UserRepository userRepository; 
  
      @PostMapping("/adminLogin")
      public User login(@RequestBody User user) throws ResourceNotFoundException {
  
          User user1 = userRepository.findByUserName(user.getUserName());
          if(user1 != null &amp;&amp; user1.getRole().equalsIgnoreCase("admin")) {
              return user1;
          }
          else 
          {
              throw new ResourceNotFoundException("Admin not found");
          }
      }
  </code></pre>
  
  <p><strong>ResourceNotFoundException.java</strong></p>
  
  <pre><code>@ResponseStatus(HttpStatus.NOT_FOUND)
  public class ResourceNotFoundException extends RuntimeException {
  
      private static final long serialVersionUID = 1L;
  
      public ResourceNotFoundException() {
          super();
      }
  
      public ResourceNotFoundException(String message) {
          super(message);
      }
  
      public ResourceNotFoundException(String message, Throwable cause) {
          super(message, cause);
      }
  }
  </code></pre>
  
  <p>My Postman URL
  <a href="http://localhost:8989/api/adminLogin" rel="noreferrer">http://localhost:8989/api/adminLogin</a></p>
  
  <p>My admin login success is working fine</p>