networkprotocolmodules/common/suplrrlpasn1/src/rrlputils.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 16:07:50 +0300
branchRCL_3
changeset 65 a796fdeeb33c
parent 0 9cfd9a3ee49c
permissions -rw-r--r--
Revision: 201035 Kit: 201041

// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

/**
 @file
 @internalTechnology
 
*/
#include <e32base.h>
#include "rrlputils.h"
#include "supldevloggermacros.h" 
#include "rtxErrCodes.h"

/**
Translates error codes returned by the ASN1 runtime library to distinguish
from Symbian global error codes.

Errors are simply translated to positive error codes. They maintain their
meaning as described in rtxErrCodes.h and asn1ErrCodes.h.

Exceptions:
  RTERR_NOMEM is translated to global error code KErrNoMemory

@see rtxErrCodes.h
@see asn1ErrCodes.h
*/
TInt RrlpUtils::ProcessAsn1Error(TInt aError)
	{
	SUPLLOG(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() Begin\n");
	if (aError == RTERR_NOMEM)
		{
		SUPLLOG(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() End (Out Of Memory)\n");
		return KErrNoMemory;
		}
	else
		{
		SUPLLOG2(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() End (ASN1Error runtime error %d)\n", aError);
		return aError * -1;
		}
	}