public class ResponseBuilder extends Object
Throwable
s to ResponseWithErrorCode
s.
Note that CloudLoggerFactory
is not used here to avoid recursion.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_STACK_TRACE_LEVEL |
Constructor and Description |
---|
ResponseBuilder() |
Modifier and Type | Method and Description |
---|---|
ResponseWithErrorCode |
build(Throwable throwable) |
<ThrowableT extends Throwable & WithErrorResponse> |
logAsError(Class<ThrowableT> throwableClass) |
<ThrowableT extends Throwable & WithErrorResponse> |
logAsInfo(Class<ThrowableT> throwableClass) |
<ThrowableT extends Throwable & WithErrorResponse> |
logAsLevel(Class<ThrowableT> throwableClass,
LogLevel logLevel) |
<ThrowableT extends Throwable & WithErrorResponse> |
logAsWarning(Class<ThrowableT> throwableClass) |
static ResponseBuilder |
newBuilder() |
ResponseBuilder |
withMapper(ResponseMapper<?> responseMapper) |
<ThrowableT extends Throwable & WithErrorResponse> |
withMapper(ResponseMapper<ThrowableT> responseMapper,
LogLevel logLevel) |
public static final int MAX_STACK_TRACE_LEVEL
public static ResponseBuilder newBuilder()
public ResponseBuilder withMapper(ResponseMapper<?> responseMapper)
public <ThrowableT extends Throwable & WithErrorResponse> ResponseBuilder withMapper(ResponseMapper<ThrowableT> responseMapper, LogLevel logLevel)
public <ThrowableT extends Throwable & WithErrorResponse> ResponseBuilder logAsLevel(Class<ThrowableT> throwableClass, LogLevel logLevel)
public <ThrowableT extends Throwable & WithErrorResponse> ResponseBuilder logAsError(Class<ThrowableT> throwableClass)
public <ThrowableT extends Throwable & WithErrorResponse> ResponseBuilder logAsWarning(Class<ThrowableT> throwableClass)
public <ThrowableT extends Throwable & WithErrorResponse> ResponseBuilder logAsInfo(Class<ThrowableT> throwableClass)
public ResponseWithErrorCode build(Throwable throwable)
Copyright © 2017 SAP SE. All rights reserved.