browserplugin/cpixnpplugin/inc/cpixnpexceptions.h
changeset 0 ccd0fd43f247
equal deleted inserted replaced
-1:000000000000 0:ccd0fd43f247
       
     1 /*
       
     2 * Copyright (c) 2010 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: 
       
    15 *
       
    16 */
       
    17 #ifndef CPIXNPEXCEPTIONS_H_
       
    18 #define CPIXNPEXCEPTIONS_H_
       
    19 
       
    20 #include <e32std.h>
       
    21 
       
    22 /*
       
    23  * CPix NP Plugin provides its own exceptions, that are 
       
    24  * based on plain text codes. The reason for using strings to
       
    25  * represent exceptions is simply, because NPN_SetException 
       
    26  * accepts only strings as exception codes. Also strings are expected
       
    27  * to be more informative and convinient for JavaScript programmers.
       
    28  * 
       
    29  * CPixNPException is used to declare CPix NP Plugin exceptions and 
       
    30  * for convert both CPix error codes and S60 system wide error codes
       
    31  * into CPix NP exception format. 
       
    32  */
       
    33 
       
    34 _LIT8( KCPixNPCannotOpenDatabaseException, "CannotOpenDatabaseException" );
       
    35 _LIT8( KCPixNPQueryParsingFailedException, "QueryParsingFailedException" );
       
    36 _LIT8( KCPixNPDatabaseQueryFailedException, "DatabaseQueryFailedException" );
       
    37 _LIT8( KCPixNPDocumentAccessFailedException, "DocumentAccessFailedException" );
       
    38 
       
    39 _LIT8( KCPixNPIllegalArgumentException, "IllegalArgumentException" );
       
    40 _LIT8( KCPixNPNotEnoughArgumentsException, "NotEnoughArgumentsException" );
       
    41 _LIT8( KCPixNPInternalError, "InternalError" );
       
    42 
       
    43 // Translations from S60 System wide error codes
       
    44 _LIT8( KCPixNPInUseException, "InUseException" );
       
    45 _LIT8( KCPixNPServerTerminated, "ServerTerminatedException" );
       
    46 _LIT8( KCPixNPServerBusy, "ServerBusyException" );
       
    47 _LIT8( KCPixNPCouldNotConnect, "CouldNotConnectException" );
       
    48 
       
    49 _LIT8( KCPixNPUnknownException, "UnknownException" );
       
    50 
       
    51 /**
       
    52  * Describes the given error code. Returns NULL if given code
       
    53  * is KErrNone. 
       
    54  * 
       
    55  * @return CPix NPlugin error code string or NULL for KErrNone. Does not return ownership. 
       
    56  */
       
    57 const TDesC8* DescribeErrorCode( TInt aErrorCode ); 
       
    58 
       
    59 #endif /*CPIXNPEXCEPTIONS_H_*/