Package net.shibboleth.shared.xml.impl

# Class LoggingErrorHandler

java.lang.Object
net.shibboleth.shared.xml.impl.LoggingErrorHandler

All Implemented Interfaces:
  `ErrorHandler`

public final class LoggingErrorHandler extends Object implements ErrorHandler
A SAX error handler that logs errors to a `Logger` before rethrowing them.

## Field Summary

Fields
Modifier and Type
Field
Description
`private org.slf4j.Logger`
`log`
Error logger.
`private boolean`
`logException`
Whether to pass exception to logger.

## Constructor Summary

Constructors
Constructor
Description
`LoggingErrorHandler(org.slf4j.Logger logger)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`error(SAXParseException exception)`
`void`
`fatalError(SAXParseException exception)`
`void`
`setLogException(boolean flag)`
Set whether to log the exception or just a message.
`void`
`warning(SAXParseException exception)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

@Nonnull private org.slf4j.Logger log
Error logger.

### logException

private boolean logException
Whether to pass exception to logger.

## Constructor Details

### LoggingErrorHandler

public LoggingErrorHandler(@Nonnull org.slf4j.Logger logger)
Constructor.

Parameters:
  `logger` - logger errors will be written to

## Method Details

### setLogException

public void setLogException(boolean flag)
Set whether to log the exception or just a message.

Parameters:
  `flag` - flag to set

### error

public void error(SAXParseException exception) throws SAXException

Specified by:
  `error` in interface `ErrorHandler`
Throws:
  `SAXException`

### fatalError

public void fatalError(SAXParseException exception) throws SAXException

Specified by:
  `fatalError` in interface `ErrorHandler`
Throws:
  `SAXException`

### warning

public void warning(SAXParseException exception) throws SAXException

Specified by:
  `warning` in interface `ErrorHandler`
Throws:
  `SAXException`