public static class UserException.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
UserException.Builder |
addContext(CustomErrorContext context) |
UserException.Builder |
addContext(String value)
add a string line to the bottom of the context
|
UserException.Builder |
addContext(String name,
double value)
add a double value to the bottom of the context
|
UserException.Builder |
addContext(String name,
long value)
add a long value to the bottom of the context
|
UserException.Builder |
addContext(String value,
Object... args)
add a string line to the bottom of the context
|
UserException.Builder |
addContext(String name,
String value)
add a string value to the bottom of the context
|
UserException.Builder |
addIdentity(CoordinationProtos.DrillbitEndpoint endpoint)
add DrillbitEndpoint identity to the context.
|
UserException |
build()
Deprecated.
Use
build(Logger) instead. If the error is a system error, the error message is logged to
this UserException.logger. |
UserException |
build(org.slf4j.Logger logger)
builds a user exception or returns the wrapped one.
|
UserException.Builder |
message(String format,
Object... args)
sets or replaces the error message.
|
UserException.Builder |
pushContext(String value)
pushes a string value to the top of the context
|
UserException.Builder |
pushContext(String name,
double value)
pushes a double value to the top of the context
|
UserException.Builder |
pushContext(String name,
long value)
pushes a long value to the top of the context
|
UserException.Builder |
pushContext(String name,
String value)
pushes a string value to the top of the context
|
public UserException.Builder message(String format, Object... args)
This will be ignored if this builder is wrapping a user exception
format - format stringargs - Arguments referenced by the format specifiers in the format stringString.format(String, Object...)public UserException.Builder addIdentity(CoordinationProtos.DrillbitEndpoint endpoint)
if the context already has a drillbitEndpoint identity, the new identity will be ignored
endpoint - drillbit endpoint identitypublic UserException.Builder addContext(String value)
value - string linepublic UserException.Builder addContext(String value, Object... args)
value - string linepublic UserException.Builder addContext(String name, String value)
name - context namevalue - context valuepublic UserException.Builder addContext(String name, long value)
name - context namevalue - context valuepublic UserException.Builder addContext(String name, double value)
name - context namevalue - context valuepublic UserException.Builder addContext(CustomErrorContext context)
public UserException.Builder pushContext(String value)
value - context valuepublic UserException.Builder pushContext(String name, String value)
name - context namevalue - context valuepublic UserException.Builder pushContext(String name, long value)
name - context namevalue - context valuepublic UserException.Builder pushContext(String name, double value)
name - context namevalue - context valuepublic UserException build(org.slf4j.Logger logger)
Logger.logger - the logger to write to@Deprecated public UserException build()
build(Logger) instead. If the error is a system error, the error message is logged to
this UserException.logger.Copyright © 2021 The Apache Software Foundation. All rights reserved.