[SecureElement] Added fixes for transmit function. 71/71371/1
authorTomasz Marciniak <t.marciniak@samsung.com>
Wed, 25 May 2016 07:01:22 +0000 (09:01 +0200)
committerTomasz Marciniak <t.marciniak@samsung.com>
Wed, 25 May 2016 07:01:22 +0000 (09:01 +0200)
[Verification] Code compiles. Related tests pass.

Change-Id: I9bfe3acd7a94da866f7e8b928d1225ba3db1920f
Signed-off-by: Tomasz Marciniak <t.marciniak@samsung.com>
src/secureelement/secureelement_api.js
src/secureelement/secureelement_instance.cc

index 09b53b314e12cb0858c103afe5dcf96175ece7fb..ccbcde282a7342a99712ffe9bd46d3ad5f0caa80 100644 (file)
@@ -267,8 +267,7 @@ Channel.prototype.transmit = function() {
         if ( native_.isFailure(result)) {
             native_.callIfPossible( args.errorCallback, native_.getErrorObject(result));
         } else {
-            var result_obj = native_.getResultObject(result);
-            args.successCallback(result_obj.response);
+            args.successCallback(native_.getResultObject(result));
         }
     }
 
index acd45b5e2277784a6e6176761e24f115540ffe70..3b78716124698dfd8e8f295f1afa8a5bee90e879 100644 (file)
@@ -372,15 +372,15 @@ void SecureElementInstance::Transmit( const picojson::value& args, picojson::obj
             }
             ReportSuccess( result, response->get<picojson::object>());
         } catch (const ErrorIO& err) {
-            LogAndReportError(PlatformResult(ErrorCode::IO_ERR), &response->get<picojson::object>());
+            LogAndReportError(PlatformResult(ErrorCode::IO_ERR, "Failed to transmit command."), &response->get<picojson::object>());
         } catch (const ErrorIllegalState& err) {
-            LogAndReportError(PlatformResult(ErrorCode::INVALID_STATE_ERR), &response->get<picojson::object>());
+            LogAndReportError(PlatformResult(ErrorCode::INVALID_STATE_ERR, "Failed to transmit command."), &response->get<picojson::object>());
         } catch (const ErrorIllegalParameter& err) {
-            LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR), &response->get<picojson::object>());
+            LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Failed to transmit command."), &response->get<picojson::object>());
         } catch (const ErrorSecurity& err) {
-            LogAndReportError(PlatformResult(ErrorCode::SECURITY_ERR), &response->get<picojson::object>());
+            LogAndReportError(PlatformResult(ErrorCode::SECURITY_ERR, "Failed to transmit command."), &response->get<picojson::object>());
         } catch (const ExceptionBase& err) {
-            LogAndReportError(PlatformResult(ErrorCode::UNKNOWN_ERR), &response->get<picojson::object>());
+            LogAndReportError(PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to transmit command."), &response->get<picojson::object>());
         }
     };