public class ErrorResponseBuilder 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 |
protected IdentityHashMap<Class<?>,ResponseMapper<?>> |
responseMappers |
Constructor and Description |
---|
ErrorResponseBuilder() |
public static final int MAX_STACK_TRACE_LEVEL
protected final IdentityHashMap<Class<?>,ResponseMapper<?>> responseMappers
public static ErrorResponseBuilder newBuilder()
public ErrorResponseBuilder withMapper(ResponseMapper<?> responseMapper)
public <ThrowableT extends Throwable & WithErrorResponse> ErrorResponseBuilder withMapper(ResponseMapper<ThrowableT> responseMapper, LogLevel logLevel)
public <ThrowableT extends Throwable & WithErrorResponse> ErrorResponseBuilder logAsLevel(Class<ThrowableT> throwableClass, LogLevel logLevel)
public <ThrowableT extends Throwable & WithErrorResponse> ErrorResponseBuilder logAsError(Class<ThrowableT> throwableClass)
public <ThrowableT extends Throwable & WithErrorResponse> ErrorResponseBuilder logAsWarning(Class<ThrowableT> throwableClass)
public <ThrowableT extends Throwable & WithErrorResponse> ErrorResponseBuilder logAsInfo(Class<ThrowableT> throwableClass)
public <ThrowableT extends Throwable> ErrorResponseBuilder removeMapping(Class<ThrowableT> throwableClass)
public ResponseWithErrorCode build(Throwable throwable)
protected int getMaxStackTraceLevel()
protected ResponseWithErrorCode toResponse(Throwable throwable, int stackTraceLevel)
protected ResponseWithErrorCode toResponse(Throwable throwable)
Copyright © 2018 SAP SE. All rights reserved.