X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fnotification%2Fandroid%2Fnotification-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fiotivity%2Fservice%2Fns%2Fcommon%2FNSException.java;h=6b639f5b43c238f1a580c8e1a8d551eb2e2f4869;hb=3c093548382bb2542c87a67e6e5fa32552c29cb3;hp=b6b764966598de47d2e661a97113500ab8bffd32;hpb=edcfc3d2329da7b914771c0dcff5f42c9b74fd93;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/notification/android/notification-service/src/main/java/org/iotivity/service/ns/common/NSException.java b/service/notification/android/notification-service/src/main/java/org/iotivity/service/ns/common/NSException.java index b6b7649..6b639f5 100755 --- a/service/notification/android/notification-service/src/main/java/org/iotivity/service/ns/common/NSException.java +++ b/service/notification/android/notification-service/src/main/java/org/iotivity/service/ns/common/NSException.java @@ -20,42 +20,42 @@ package org.iotivity.service.ns.common; -public class NSException extends Exception -{ +/** + * + * This class provides implementation of exceptions thrown by API's. + * + */ +public class NSException extends Exception { + private NSErrorCode errorCode; - public NSException(NSErrorCode errorCode, String errMessage) - { + public NSException(NSErrorCode errorCode, String errMessage) { super(errMessage + " " + errorCode.toString()); this.errorCode = errorCode; } - private NSException(String error, String errMessage) - { + private NSException(String error, String errMessage) { super(errMessage + " " + error); this.errorCode = NSErrorCode.get(error); } - public NSErrorCode getErrorCode() - { + public NSErrorCode getErrorCode() { return errorCode; } - private static void addStackTrace(Throwable throwable, - String file, - String functionName, - int line) - { + private static void addStackTrace(Throwable throwable, String file, + String functionName, int line) { StackTraceElement[] stack = throwable.getStackTrace(); StackTraceElement[] newStack = new StackTraceElement[stack.length + 1]; System.arraycopy(stack, 0, newStack, 1, stack.length); - newStack[0] = new StackTraceElement("", functionName, file, line); + newStack[0] = new StackTraceElement("", functionName, file, + line); throwable.setStackTrace(newStack); } - private void setNativeExceptionLocation(String file, String functionName, int line) - { + private void setNativeExceptionLocation(String file, String functionName, + int line) { NSException.addStackTrace(this, file, functionName, line); } } \ No newline at end of file