Hi Biruntha,

Why do you want to catch a general exception here?

You can simply catch AxisFault since SMSMesage uses axis2 transport and
throws AxisFault.

try {
    smsMessage = new SMSMessage(SMPPConstants.SENDER, phoneNo,
message, SMSMessage.OUT_MESSAGE);
    manager.sentInfo(smsMessage);
} catch (AxisFault axisFault) {
    handleException("Error while sending SMS: " +
axisFault.getMessage(), messageContext);
}


On Fri, Jun 10, 2016 at 4:04 PM, Biruntha Gnaneswaran <[email protected]>
wrote:

> Hi Devs,
>
> I want to send SMS using axis2 SMS Transport [1] . I try with below code.
> It works fine in normal case. Here sentInfo() is used to send SMS. But if
> there is an exception in sentInfo() method, I couldn’t catch that
> exception from my code. Because sendSMS() method in SMPPImplManager class
> didn’t throw any exception.
>
> Is there any way to solve this problem?
>
> *try *{    smsMessage = *new *SMSMessage(sender,phoneNo,message,*2*);    
> manager.sentInfo(smsMessage);    *log*.info(*"Successfully completed sending 
> SMS"*);} *catch *(Exception e){    handleException(*"Error while sending SMS: 
> " *+ e.getMessage(), e, messageContext);}
>
> [1]
> https://github.com/wso2/wso2-axis2-transports/tree/master/modules/sms/src/main/java/org/apache/axis2/transport/sms
>
> Thankyou,
>
> Biruntha
>
> Associate Software Engineer
> WSO2
> Email : [email protected]
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thank you
Best Regards

*Rajjaz HM*
Associate Software Engineer
Platform Extension Team
WSO2 Inc. <http://wso2.com/>
lean | enterprise | middleware
Mobile | +94752833834|+94777226874
Email   | [email protected]
LinkedIn <https://lk.linkedin.com/in/hmohammedrajjaz> | Blogger
<http://rajjazhm.blogspot.com/> | WSO2 Profile
<http://wso2.com/about/team/mohammer-rajjaz/>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to