-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[guide] add sections for system properties and exception handler. Fixes
- Loading branch information
Showing
8 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
docs/griffon-guide/src/docs/asciidoc/appendix/appendix-system-properties.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
[[_appendix_system_properties]] | ||
= System Properties | ||
|
||
The following list summarizes all System properties that the Griffon runtime may use | ||
|
||
[options="header"] | ||
|=== | ||
| Property | Chapter | ||
| `griffon.env` | <<_overview_metadata_environment,Overview - Metadata - Application Environment>> | ||
| `griffon.exception.output` | <<_overview_exception_handler,Overview - Exception Handler>> | ||
| `griffon.full.stacktrace` | <<_overview_exception_handler,Overview - Exception Handler>> | ||
| `griffon.sanitized.stacktraces` | <<_overview_exception_handler,Overview - Exception Handler>> | ||
|=== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
docs/griffon-guide/src/docs/asciidoc/overview/overview-exception-handler.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
[[_overview_exception_handler]] | ||
= Exception Handler | ||
|
||
Griffon provides a centralized exception management facility: `{link_exception_handler}`. An instance of this type | ||
is automatically registered with the application's runtime to react to exceptions that are not caught by the | ||
application's code. In a sense it works like an uncuaght exception handler that's attached to all threads, including | ||
the UI thread. | ||
|
||
An `ExceptionHandler` has three responsibilities: | ||
|
||
. Filter out stacktraces to reduce the amount of noise. | ||
. Output the exception to a log file and/or the console. | ||
. Pump events to the application's `{link_event_router}`. | ||
|
||
Filtering out stacktraces can be configured by setting a System property named `griffon.full.stacktrace` whose value | ||
defaults to `false`. This means stacktraces will be filtered by default if no configuration changes are made. Uncaught | ||
exceptions are automatically logged with an `ERROR` level. You cat set the System property `griffon.exception.output` to | ||
`true` if you'd like to see the stacktraces forwarded to the console's output. Finally, the System property `griffon.sanitized.stacktraces` | ||
defines the package patterns used to filter out stractrace lines. The default package patterns used are: | ||
|
||
* `org.codehaus.groovy.` | ||
* `org.codehaus.griffon.` | ||
* `groovy.` | ||
* `java.` | ||
* `javax.` | ||
* `sun.` | ||
* `com.sun.` | ||
|
||
The `ExceptionHandler` will trigger the followoing events when an exception occurs. | ||
[horizontal] | ||
Uncaught<ShortName>(Throwable t):: Triggered after the `Throwable` has had its stacktraces filtered. | ||
UncaughtExceptionThrown(Throwable t):: Triggered after the previous event. | ||
|
||
For the first event, `<ShortName>` refers to the Throwable's short class name. If an exception of type | ||
`java.lang.IllegalArgumentException` was caught by the `ExceptionHandler` then the event name would become | ||
`UncaughtIllegalArgumentException`. | ||
|
||
Please refer to the <<_events,Events>> chapter in order to find out how these events may be handled. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters