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.
Modifiers | Name | Description |
---|---|---|
static String |
STACK_LOG_NAME |
Type | Name and description |
---|---|
static void |
addClassTest(Closure test) Adds a groovy.lang.Closure to test whether the stack trace element should be added or not. |
static Throwable |
deepSanitize(Throwable t) Sanitize the exception and ALL nested causes |
static Throwable |
extractRootCause(Throwable t) Extracts the root cause of the exception, no matter how nested it is |
static boolean |
isApplicationClass(String className) |
static void |
printSanitizedStackTrace(Throwable t, PrintWriter p) |
static void |
printSanitizedStackTrace(Throwable t) |
static Throwable |
sanitize(Throwable t) Remove all apparently groovy-internal trace entries from the exception instance |
static Throwable |
sanitizeRootCause(Throwable t) Get the root cause of an exception and sanitize it for display to the user |
Adds a groovy.lang.Closure to test whether the stack trace element should be added or not.
The groovy.lang.Closure will be given the class name as parameter. the return value decides if the element will be added or not.
test
- the testing groovy.lang.ClosureSanitize the exception and ALL nested causes
This will MODIFY the stacktrace of the exception instance and all its causes irreversibly
t
- a throwableExtracts the root cause of the exception, no matter how nested it is
t
- a ThrowableRemove all apparently groovy-internal trace entries from the exception instance
This modifies the original instance and returns it, it does not clone
t
- the Throwable whose stack trace we want to sanitizeGet the root cause of an exception and sanitize it for display to the user
This will MODIFY the stacktrace of the root cause exception object and return it
t
- a throwable