Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
  * regarding copyright ownership.  The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.sling.engine.servlets;
The ErrorHandler defines the interface of the service used by the Sling to handle calls to HttpServletResponse.sendError and to handle uncaught Throwables.
public interface ErrorHandler {

    
Called to render a response for a HTTP status code. This method should set the response status and print the status code and optional message.

If the response has already been committed, an error message should be logged but no further processing should take place.

Parameters:
status The HTTP status code to set
message An optional message to write to the response. This message may be null.
request The request object providing more information on the request.
response The response object used to send the status and message.
Throws:
java.io.IOException May be thrown if an error occurrs sending the response.
    void handleError(int statusString message,
            SlingHttpServletRequest requestSlingHttpServletResponse response)
            throws IOException;

    
Called to render a response for an uncaught Throwable.

If the response has already been committed, an error message should be logged but no further processing should take place.

Parameters:
throwable The Throwable causing this method to be called.
request The request object providing more information on the request.
response The response object used to send the status and message.
Throws:
java.io.IOException May be thrown if an error occurrs sending the response.
    void handleError(Throwable throwableSlingHttpServletRequest request,
            SlingHttpServletResponse responsethrows IOException;
New to GrepCode? Check out our FAQ X