From a00f6ade19477eb4286379779b8114e149fe6a82 Mon Sep 17 00:00:00 2001 From: "santhosh.au" Date: Fri, 30 Aug 2013 17:17:40 +0530 Subject: [PATCH] Fixes to send 2.2.1 exceptions for EncodeToFile API Change-Id: I24a1b87b6dcebf666c0860def77b6d8c7c0e7e67 Signed-off-by: santhosh.au --- src/FUixVisionQrCodeGenerator.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/FUixVisionQrCodeGenerator.cpp b/src/FUixVisionQrCodeGenerator.cpp index d761e64..c39e5cd 100644 --- a/src/FUixVisionQrCodeGenerator.cpp +++ b/src/FUixVisionQrCodeGenerator.cpp @@ -95,14 +95,25 @@ QrCodeGenerator::EncodeToFile(const Tizen::Base::String& message, QrCodeMode mod std::unique_ptr pBuffer(utf8.GetBytesN(message)); if (!__pQrCodeGeneratorImpl->Encode((char*) pBuffer->GetPointer(), mode, errorCorrectionLevel, compatibility)) { - return E_OPERATION_FAILED; + return E_FAILURE; } if(!__pQrCodeGeneratorImpl->SaveToFile(imageFilePath, imageFormat,width, height)) { r = GetLastResult(); if( r == E_ILLEGAL_ACCESS || r == E_OUT_OF_RANGE) - r = E_FILE_NOT_FOUND; + { + r = E_FILE_NOT_FOUND; + } + else if (r == E_UNSUPPORTED_FORMAT) + { + r = E_INVALID_ARG; + } + else + { + r = E_FAILURE; + } + } return r; -- 2.7.4