Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## org.codehaus.groovy.grails.exceptions
[Groovy] Class DefaultErrorsPrinter

    java.lang.Object
      org.codehaus.groovy.grails.exceptions.DefaultStackTracePrinter
          org.codehaus.groovy.grails.exceptions.DefaultErrorsPrinter

All Implemented Interfaces:
  CodeSnippetPrinter

    class DefaultErrorsPrinter
    extends DefaultStackTracePrinter

Default implementation of the StackTracePrinter interface.

Authors:
  Graeme Rocher
  Marc Palmer

Since:
  2.0

Property Summary
`ResourceLocator` | `resourceLocator`

Constructor Summary
`DefaultErrorsPrinter()`
`DefaultErrorsPrinter(ResourceLocator resourceLocator)`

Method Summary
`java.lang.String` | `formatCodeSnippetEnd(Resource resource, int lineNumber)`
`protected java.lang.String` | `formatCodeSnippetErrorLine(int currentLineNumber, java.lang.Object currentLine)`
`protected java.lang.String` | `formatCodeSnippetLine(int currentLineNumber, java.lang.Object currentLine)`
`java.lang.String` | `formatCodeSnippetStart(Resource resource, int lineNumber)`
`protected java.lang.String` | `getFileName(java.lang.StackTraceElement te)`
`protected Resource` | `getFileNameInfo(java.lang.Throwable cause, Resource res)`
`protected int` | `getLineNumberInfo(java.lang.Throwable cause, int defaultInfo)`
`protected java.lang.Throwable` | `getRootCause(java.lang.Throwable ex)` Obtains the root cause of the given exception
`java.lang.String` | `prettyPrintCodeSnippet(java.lang.Throwable exception)`

Methods inherited from class DefaultStackTracePrinter
getFileName, makeRelativeIfPossible, prettyPrint, printCausedByMessage, printFailureLocation, printHeader, printLastEntry, printStackLine, shouldSkipNextCause

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Property Detail

### resourceLocator

    ResourceLocator resourceLocator

Constructor Detail

### DefaultErrorsPrinter

    DefaultErrorsPrinter()

### DefaultErrorsPrinter

    DefaultErrorsPrinter(ResourceLocator resourceLocator)

Method Detail

### formatCodeSnippetEnd

    java.lang.String formatCodeSnippetEnd(Resource resource, int lineNumber)

### formatCodeSnippetErrorLine

    protected java.lang.String formatCodeSnippetErrorLine(int currentLineNumber, java.lang.Object currentLine)

### formatCodeSnippetLine

    protected java.lang.String formatCodeSnippetLine(int currentLineNumber, java.lang.Object currentLine)

### formatCodeSnippetStart

    java.lang.String formatCodeSnippetStart(Resource resource, int lineNumber)

### getFileName

    protected java.lang.String getFileName(java.lang.StackTraceElement te)

### getFileNameInfo

    protected Resource getFileNameInfo(java.lang.Throwable cause, Resource res)

### getLineNumberInfo

    protected int getLineNumberInfo(java.lang.Throwable cause, int defaultInfo)

### getRootCause

    protected java.lang.Throwable getRootCause(java.lang.Throwable ex)

  Obtains the root cause of the given exception
  Parameters:
    `ex` - The exception
  Returns:
    The root cause

### prettyPrintCodeSnippet

    java.lang.String prettyPrintCodeSnippet(java.lang.Throwable exception)

Groovy Documentation