本文整理汇总了Java中org.red5.server.exception.ClientDetailsException类的典型用法代码示例。如果您正苦于以下问题:Java ClientDetailsException类的具体用法?Java ClientDetailsException怎么用?Java ClientDetailsException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClientDetailsException类属于org.red5.server.exception包,在下文中一共展示了ClientDetailsException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateErrorResult
import org.red5.server.exception.ClientDetailsException; //导入依赖的package包/类
/**
* Generate error object to return for given exception.
*
* @param code
* call
* @param error
* error
* @return status object
*/
protected StatusObject generateErrorResult(String code, Throwable error) {
// Construct error object to return
String message = "";
while (error != null && error.getCause() != null) {
error = error.getCause();
}
if (error != null && error.getMessage() != null) {
message = error.getMessage();
}
StatusObject status = new StatusObject(code, "error", message);
if (error instanceof ClientDetailsException) {
// Return exception details to client
status.setApplication(((ClientDetailsException) error).getParameters());
if (((ClientDetailsException) error).includeStacktrace()) {
List<String> stack = new ArrayList<String>();
for (StackTraceElement element : error.getStackTrace()) {
stack.add(element.toString());
}
status.setAdditional("stacktrace", stack);
}
} else if (error != null) {
status.setApplication(error.getClass().getCanonicalName());
}
return status;
}
示例2: returnError
import org.red5.server.exception.ClientDetailsException; //导入依赖的package包/类
/**
* Construct error message from exception.
*
* @param request
* request
* @param faultCode
* fault code
* @param faultString
* fautl string
* @param error
* error
* @return message
*/
public static ErrorMessage returnError(AbstractMessage request, String faultCode, String faultString, Throwable error) {
ErrorMessage result = returnError(request, faultCode, faultString, "");
if (error instanceof ClientDetailsException) {
result.extendedData = ((ClientDetailsException) error).getParameters();
if (((ClientDetailsException) error).includeStacktrace()) {
StringBuilder stack = new StringBuilder();
for (StackTraceElement element : error.getStackTrace()) {
stack.append(element.toString()).append('\n');
}
result.faultDetail = stack.toString();
}
}
result.rootCause = error;
return result;
}
示例3: generateErrorResult
import org.red5.server.exception.ClientDetailsException; //导入依赖的package包/类
/**
* Generate error object to return for given exception.
*
* @param code call
* @param error error
* @return status object
*/
protected StatusObject generateErrorResult(String code, Throwable error) {
// Construct error object to return
String message = "";
while (error != null && error.getCause() != null) {
error = error.getCause();
}
if (error != null && error.getMessage() != null) {
message = error.getMessage();
}
StatusObject status = new StatusObject(code, "error", message);
if (error instanceof ClientDetailsException) {
// Return exception details to client
status.setApplication(((ClientDetailsException) error).getParameters());
if (((ClientDetailsException) error).includeStacktrace()) {
List<String> stack = new ArrayList<String>();
for (StackTraceElement element : error.getStackTrace()) {
stack.add(element.toString());
}
status.setAdditional("stacktrace", stack);
}
} else if (error != null) {
status.setApplication(error.getClass().getCanonicalName());
}
return status;
}
示例4: generateErrorResult
import org.red5.server.exception.ClientDetailsException; //导入依赖的package包/类
/**
* Generate error object to return for given exception.
*
* @param code call
* @param error error
* @return status object
*/
protected StatusObject generateErrorResult(String code, Throwable error) {
// Construct error object to return
String message = "";
while (error != null && error.getCause() != null) {
error = error.getCause();
}
if (error != null && error.getMessage() != null) {
message = error.getMessage();
}
StatusObject status = new StatusObject(code, "error", message);
if (error instanceof ClientDetailsException) {
// Return exception details to client
status.setApplication(((ClientDetailsException) error).getParameters());
if (((ClientDetailsException) error).includeStacktrace()) {
List<String> stack = new ArrayList<String>();
for (StackTraceElement element: error.getStackTrace()) {
stack.add(element.toString());
}
status.setAdditional("stacktrace", stack);
}
} else if (error != null) {
status.setApplication(error.getClass().getCanonicalName());
}
return status;
}
示例5: returnError
import org.red5.server.exception.ClientDetailsException; //导入依赖的package包/类
/**
* Construct error message from exception.
*
* @param request request
* @param faultCode fault code
* @param faultString fautl string
* @param error error
* @return message
*/
public static ErrorMessage returnError(AbstractMessage request, String faultCode, String faultString,
Throwable error) {
ErrorMessage result = returnError(request, faultCode, faultString, "");
if (error instanceof ClientDetailsException) {
result.extendedData = ((ClientDetailsException) error).getParameters();
if (((ClientDetailsException) error).includeStacktrace()) {
StringBuilder stack = new StringBuilder();
for (StackTraceElement element : error.getStackTrace()) {
stack.append(element.toString()).append('\n');
}
result.faultDetail = stack.toString();
}
}
result.rootCause = error;
return result;
}