Package: org.grails.core.exceptions

## [Groovy] Class DefaultErrorsPrinter

- org.grails.core.exceptions.DefaultErrorsPrinter

- All Implemented Interfaces and Traits:
    CodeSnippetPrinter

      class DefaultErrorsPrinter
      extends DefaultStackTracePrinter
      implements CodeSnippetPrinter

  Default implementation of the StackTracePrinter interface.

  Since:
    2.0
  Authors:
    Graeme Rocher
    Marc Palmer

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private ResourceLocator` | `resourceLocator` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `ResourceLocator` | `resourceLocator`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `DefaultErrorsPrinter ()`
    `DefaultErrorsPrinter (ResourceLocator resourceLocator)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `java.lang.String` | `formatCodeSnippetEnd(org.springframework.core.io.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(org.springframework.core.io.Resource resource, int lineNumber)`
    `` | `protected java.lang.String` | `getFileName(java.lang.StackTraceElement te)`
    `` | `protected org.springframework.core.io.Resource` | `getFileNameInfo(java.lang.Throwable cause, org.springframework.core.io.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)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class DefaultStackTracePrinter` | `getFileName, makeRelativeIfPossible, prettyPrint, printCausedByMessage, printFailureLocation, printHeader, printLastEntry, printStackLine, shouldSkipNextCause`

- - ### Field Detail

    - #### private ResourceLocator resourceLocator

  - ### Property Detail

    - #### ResourceLocator resourceLocator

  - ### Constructor Detail

    - #### DefaultErrorsPrinter()

    - #### DefaultErrorsPrinter(ResourceLocator resourceLocator)

  - ### Method Detail

    - #### java.lang.String formatCodeSnippetEnd(org.springframework.core.io.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(org.springframework.core.io.Resource resource, int lineNumber)

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

    - #### protected org.springframework.core.io.Resource getFileNameInfo(java.lang.Throwable cause, org.springframework.core.io.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

      Parameters:
        `ex` - The exception
      Returns:
        The root cause

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