networkprotocolmodules/common/suplrrlpasn1/src/rrlputils.cpp
changeset 45 15a2125aa2f3
parent 40 18280709ae43
child 49 5f20f71a57a3
child 51 95c570bf4a05
equal deleted inserted replaced
40:18280709ae43 45:15a2125aa2f3
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalTechnology
       
    19  
       
    20 */
       
    21 #include <e32base.h>
       
    22 #include "rrlputils.h"
       
    23 #include "supldevloggermacros.h" 
       
    24 #include "rtxErrCodes.h"
       
    25 
       
    26 /**
       
    27 Translates error codes returned by the ASN1 runtime library to distinguish
       
    28 from Symbian global error codes.
       
    29 
       
    30 Errors are simply translated to positive error codes. They maintain their
       
    31 meaning as described in rtxErrCodes.h and asn1ErrCodes.h.
       
    32 
       
    33 Exceptions:
       
    34   RTERR_NOMEM is translated to global error code KErrNoMemory
       
    35 
       
    36 @see rtxErrCodes.h
       
    37 @see asn1ErrCodes.h
       
    38 */
       
    39 TInt RrlpUtils::ProcessAsn1Error(TInt aError)
       
    40 	{
       
    41 	SUPLLOG(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() Begin\n");
       
    42 	if (aError == RTERR_NOMEM)
       
    43 		{
       
    44 		SUPLLOG(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() End (Out Of Memory)\n");
       
    45 		return KErrNoMemory;
       
    46 		}
       
    47 	else
       
    48 		{
       
    49 		SUPLLOG2(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() End (ASN1Error runtime error %d)\n", aError);
       
    50 		return aError * -1;
       
    51 		}
       
    52 	}
       
    53 
       
    54