title: Determination severity of message/growl in p:growl
body: <p>I have following code in my backing bean:</p>
  
  <pre><code>try {
      contractService.create(selectedContract);
      conversation.end();
      return "search?faces-redirect=true";
  } catch (ActiveContractExistsException e) {
      FacesContext context = FacesContext.getCurrentInstance();
      context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, null, e.getMessage()));
      return null;
  }
  </code></pre>
  
  <p>In jsf:</p>
  
  <pre><code>&lt;p:growl id="growl" showDetail="true" showSummary="false" closable="true" autoUpdate="true"/&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>&lt;p:commandButton value="Save" actionListener="#{contractView.update}" update="growl"/&gt;
  </code></pre>
  
  <p>As a result I'm getting:</p>
  
  <p><a href="https://i.stack.imgur.com/PuE6d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PuE6d.png" alt="enter image description here"></a> </p>
  
  <p>Like you can see this is far from <code>SEVERITY_ERROR</code>. But the most interesting part is when my code is following (adding message outside the <code>catch</code> block):</p>
  
  <pre><code>    try {
          contractService.create(selectedContract);
          conversation.end();
          FacesContext context = FacesContext.getCurrentInstance();
          context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "Some message"));
          return "search?faces-redirect=true";
      } catch (ActiveContractExistsException e) {
          //FacesContext context = FacesContext.getCurrentInstance();
          //context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "Some message"/*e.getMessage()*/));
          return null;
      }
  </code></pre>
  
  <p>then all fine:</p>
  
  <p><a href="https://i.stack.imgur.com/NdOUu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NdOUu.png" alt="enter image description here"></a></p>
  
  <p>How can I set <code>SEVERITY_ERROR</code> level to my message while handling exception?</p>