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 intgetReason()
Private Attributes
intmLeaveCode

Constructor & Destructor Documentation

HsException(int)

IMPORT_CHsException(intaLeaveCode)

Constructor of the HsException.

Parameters

int aLeaveCode

~HsException()

IMPORT_C~HsException()[virtual]

Destructor of the HsException.

Member Functions Documentation

getReason()

IMPORT_C intgetReason()

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

intmLeaveCode[private]