From: Tomasz Marciniak Date: Wed, 25 May 2016 07:01:22 +0000 (+0200) Subject: [SecureElement] Added fixes for transmit function. X-Git-Tag: submit/tizen/20160525.074849~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f035749438373fc37a9b05aa0349c55b1ca0d762;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [SecureElement] Added fixes for transmit function. [Verification] Code compiles. Related tests pass. Change-Id: I9bfe3acd7a94da866f7e8b928d1225ba3db1920f Signed-off-by: Tomasz Marciniak --- diff --git a/src/secureelement/secureelement_api.js b/src/secureelement/secureelement_api.js index 09b53b31..ccbcde28 100644 --- a/src/secureelement/secureelement_api.js +++ b/src/secureelement/secureelement_api.js @@ -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)); } } diff --git a/src/secureelement/secureelement_instance.cc b/src/secureelement/secureelement_instance.cc index acd45b5e..3b787161 100644 --- a/src/secureelement/secureelement_instance.cc +++ b/src/secureelement/secureelement_instance.cc @@ -372,15 +372,15 @@ void SecureElementInstance::Transmit( const picojson::value& args, picojson::obj } ReportSuccess( result, response->get()); } catch (const ErrorIO& err) { - LogAndReportError(PlatformResult(ErrorCode::IO_ERR), &response->get()); + LogAndReportError(PlatformResult(ErrorCode::IO_ERR, "Failed to transmit command."), &response->get()); } catch (const ErrorIllegalState& err) { - LogAndReportError(PlatformResult(ErrorCode::INVALID_STATE_ERR), &response->get()); + LogAndReportError(PlatformResult(ErrorCode::INVALID_STATE_ERR, "Failed to transmit command."), &response->get()); } catch (const ErrorIllegalParameter& err) { - LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR), &response->get()); + LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Failed to transmit command."), &response->get()); } catch (const ErrorSecurity& err) { - LogAndReportError(PlatformResult(ErrorCode::SECURITY_ERR), &response->get()); + LogAndReportError(PlatformResult(ErrorCode::SECURITY_ERR, "Failed to transmit command."), &response->get()); } catch (const ExceptionBase& err) { - LogAndReportError(PlatformResult(ErrorCode::UNKNOWN_ERR), &response->get()); + LogAndReportError(PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to transmit command."), &response->get()); } };