Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

TwilioRestException properties are private #32

Open
force2b opened this issue Nov 11, 2013 · 2 comments
Open

TwilioRestException properties are private #32

force2b opened this issue Nov 11, 2013 · 2 comments

Comments

@force2b
Copy link

force2b commented Nov 11, 2013

I had been trying to trap twilio exceptions using a try/catch block, but discovered that the only error message returned was "unknown script exception". The root cause appears to be that the errorCode, message, moreInfo and status properties in the TwilioRestException class are private. Changing these to public allows the full error detail to be retrieved in the following code block:

try {
    TwilioSms sms = twilioAccount.getSmsMessages().create(params);
} catch (TwilioRestException e) {
    system.debug(LoggingLevel.Error, '  * Twilio Error=' + e.errorCode
    + '/' + e.message);
} catch (exception ex) { 
    /* other code */
}

More info: http://gsfn.us/t/4byl5

Best Regards,

Mike

@umeditor
Copy link

umeditor commented Sep 7, 2016

@force2b the more info link is broken. Any other place to see the background?

@force2b
Copy link
Author

force2b commented Sep 7, 2016

Not sure where that link pointed to any more. Seems like the original post or possibly the comments on it were removed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants