title: When is it ok to throw a ServletException from a Servlet?
body: <p>I have been throwing <code>ServletException</code>s in the past, when something/anything goes wrong in a Servlet, mostly just wrapping the exception in <code>ServletException</code>.</p>
  
  <p>Now I am thinking it is actually better to not throw a <code>ServletException</code> but to respond with <code>response.sendError(sc)</code> and use the correct HTTP status codes.</p>
  
  <p>If I can't send an error using <code>reponse.sendError</code>, (<code>IOException</code>), I wrap the <code>IOException</code> in a <code>ServletException</code>.</p>
  
  <p>Is the above a better way to respond?
  When is it OK to just throw a <code>ServletException</code>?</p>