Hs::HsException Class Reference

class Hs::HsException
Class used to encapsulate error information thrown in exceptions by the Homescreen Publishing Api.
        ObserverClass* dataObserver = new ObserverClass();
 try 
 {
     HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver );
     if ( hsPublisher )
     {
         HsWidget& widget =  hsPublisher->createHsWidget( 
             "templateName", "widgetName", "uniqueIdentifier" );
         //attempt to create the widget again (with the same information) 
         //will cause an exception
         hsPublisher->createHsWidget( 
             "templateName", "widgetName", "uniqueIdentifier" );
     }
 }
 catch (HsException& exception)
 {
     int errReason = exception.getReason();
     //if the exception is thrown, becasue the widget attempted to
     //be created already exists the errReason will be KErrAlreadyExists
 }
       
Public Member Functions
HsException (int)
~HsException ()
IMPORT_C int getReason ()
Private Attributes
int mLeaveCode

Constructor & Destructor Documentation

HsException(int)

IMPORT_C HsException ( int aLeaveCode )

Constructor of the HsException .

Parameters

int aLeaveCode

~HsException()

IMPORT_C ~HsException ( ) [virtual]

Destructor of the HsException .

Member Functions Documentation

getReason()

IMPORT_C int getReason ( )

Method retrieves the error information contained in the excpetion object.

         ObserverClass* dataObserver = new ObserverClass();
 try 
 {
     HsWidgetPublisher* hsPublisher = new HsWidgetPublisher(dataObserver);
     hsPublisher->createHsWidget( 
         "templateName", "widgetName", "uniqueIdentifier" );
 }
 catch (HsException& exception)
 {
      int errReason = exception.getReason();
 }
        

Member Data Documentation

int mLeaveCode

int mLeaveCode [private]