added error code (4.03 / 5.00) in ocstack result
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 12 Oct 2016 07:53:46 +0000 (16:53 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Tue, 18 Oct 2016 06:26:39 +0000 (06:26 +0000)
Change-Id: I311c0b76a2faa7704be8f4a8b89088a0ae471c6a
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13135
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: byonggon chun <bg.chun@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/stack/include/octypes.h
resource/csdk/stack/src/ocresource.c
resource/csdk/stack/src/ocstack.c

index 5a9c893..a104f16 100644 (file)
@@ -985,6 +985,11 @@ typedef enum
     OC_STACK_PRESENCE_TIMEOUT,
     OC_STACK_PRESENCE_DO_NOT_HANDLE,
 #endif
+
+    /** ERROR code from server */
+    OC_STACK_FORBIDDEN_REQ,          /** 403*/
+    OC_STACK_INTERNAL_SERVER_ERROR,  /** 500*/
+
     /** ERROR in stack.*/
     OC_STACK_ERROR = 255
     /** Error status code - END HERE.*/
index 485cc64..39a1933 100755 (executable)
@@ -483,7 +483,10 @@ OCStackResult EntityHandlerCodeToOCStackCode(OCEntityHandlerResult ehResult)
             result = OC_STACK_ERROR;
             break;
         case OC_EH_FORBIDDEN:
-            result = OC_STACK_RESOURCE_ERROR;
+            result = OC_STACK_FORBIDDEN_REQ;
+            break;
+        case OC_EH_INTERNAL_SERVER_ERROR:
+            result = OC_STACK_INTERNAL_SERVER_ERROR;
             break;
         case OC_EH_RESOURCE_CREATED:
             result = OC_STACK_RESOURCE_CREATED;
index b382b9d..1dd43aa 100644 (file)
@@ -728,6 +728,12 @@ OCStackResult CAResponseToOCStackResult(CAResponseResult_t caCode)
         case CA_REQUEST_ENTITY_TOO_LARGE:
             ret = OC_STACK_TOO_LARGE_REQ;
             break;
+        case CA_FORBIDDEN_REQ:
+            ret = OC_STACK_FORBIDDEN_REQ;
+            break;
+        case CA_INTERNAL_SERVER_ERROR:
+            ret = OC_STACK_INTERNAL_SERVER_ERROR;
+            break;
         default:
             break;
     }
@@ -786,6 +792,12 @@ CAResponseResult_t OCToCAStackResult(OCStackResult ocCode, OCMethod method)
         case OC_STACK_UNAUTHORIZED_REQ:
             ret = CA_UNAUTHORIZED_REQ;
             break;
+        case OC_STACK_FORBIDDEN_REQ:
+            ret = CA_FORBIDDEN_REQ;
+            break;
+        case OC_STACK_INTERNAL_SERVER_ERROR:
+            ret = CA_INTERNAL_SERVER_ERROR;
+            break;
         default:
             break;
     }