upnpmpxplugins/upnpplaybackplugins/src/upnppluginserrortranslation.cpp
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:      translate all plugins error code for music player
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 
       
    25 // debug
       
    26 #include <e32std.h>
       
    27 #include "upnppluginserrortranslation.h"
       
    28 _LIT( KComponentLogfile, "musicplugins.txt");
       
    29 #include "upnplog.h"
       
    30 
       
    31 // --------------------------------------------------------------------------
       
    32 // TUpnpPluginsErrorTranslation::ErrorTranslate
       
    33 // translate function
       
    34 // --------------------------------------------------------------------------
       
    35 //
       
    36 TInt TUpnpPluginsErrorTranslation::ErrorTranslate( TInt aError)
       
    37     {
       
    38     TInt newError = KErrNone;
       
    39     if ( aError != KErrNone)
       
    40         {
       
    41         __LOG1( "TUpnpPluginsErrorTranslation  err=%d", aError );
       
    42         }
       
    43     switch ( aError)
       
    44         {
       
    45         // if aError is valid, we don't need translate
       
    46         case KErrNone:
       
    47             newError = KErrNone;
       
    48             break;
       
    49         case KErrNotFound:
       
    50             newError = KErrGeneral;
       
    51             break;
       
    52         case KErrNotSupported:
       
    53             newError = KErrNotSupported;
       
    54             break;
       
    55         case KErrCorrupt:
       
    56             newError = KErrCorrupt;
       
    57             break;
       
    58         case KErrCompletion:
       
    59             newError = KErrCompletion;
       
    60             break;
       
    61         case KErrDied:
       
    62             newError = KErrDied;
       
    63             break;
       
    64         case KErrGeneral:
       
    65             newError = KErrGeneral;
       
    66             break;
       
    67         case KErrAccessDenied:
       
    68             newError = KErrAccessDenied;
       
    69             break;
       
    70         case KErrArgument:
       
    71             newError = KErrArgument;
       
    72             break;
       
    73         case KErrDisconnected:
       
    74             newError = KErrDisconnected;
       
    75             break;
       
    76         case KErrDiskFull: //consume current disk full
       
    77             newError = KErrDiskFull;
       
    78             break;
       
    79         case KErrNoMemory://consume memory entirely
       
    80             newError = KErrNoMemory;
       
    81             break;
       
    82         case KErrOverflow:
       
    83             newError = KErrGeneral;
       
    84             break;    
       
    85        	case KErrServerBusy://if Server has no memory
       
    86             newError = KErrServerBusy;
       
    87             break;
       
    88             // if aError is not valid, we need translate
       
    89         case KErrCancel: //fall through
       
    90         case KErrTotalLossOfPrecision: ////fall through
       
    91         case KErrBadHandle: //fall through
       
    92         case KErrUnderflow: //fall through
       
    93         case KErrAlreadyExists: //fall through
       
    94         case KErrPathNotFound: //fall through
       
    95         case KErrInUse: //fall through
       
    96         case KErrServerTerminated: //fall through
       
    97         case KErrNotReady: //fall through
       
    98         case KErrUnknown: //fall through
       
    99         case KErrLocked: //fall through
       
   100         case KErrWrite: //fall through
       
   101         case KErrDisMounted: //fall through
       
   102         case KErrEof: //fall through
       
   103         case KErrBadDriver: //fall through
       
   104         case KErrBadName: //fall through
       
   105         case KErrCommsLineFail: //fall through
       
   106         case KErrCommsFrame: //fall through
       
   107         case KErrCommsOverrun: //fall through
       
   108         case KErrCommsParity: //fall through
       
   109         case KErrTimedOut: //fall through
       
   110         case KErrCouldNotConnect: //fall through
       
   111         case KErrCouldNotDisconnect: //fall through
       
   112         case KErrBadLibraryEntryPoint: //fall through
       
   113         case KErrBadDescriptor: //fall through
       
   114         case KErrAbort: //fall through
       
   115         case KErrTooBig: //fall through
       
   116         case KErrDivideByZero: //fall through
       
   117         case KErrBadPower: //fall through
       
   118         case KErrDirFull: //fall through
       
   119         case KErrHardwareNotAvailable: //fall through
       
   120         case KErrSessionClosed: //fall through
       
   121         case KErrPermissionDenied: //fall through
       
   122         case KErrExtensionNotSupported: //fall through
       
   123         case KErrCommsBreak:
       
   124             newError = KErrDisconnected;
       
   125             break;
       
   126         default:
       
   127             newError = KErrDisconnected;
       
   128             break;
       
   129         }
       
   130 
       
   131     return newError;
       
   132 
       
   133     }