Error messages returned from SendMessage occasionally have useful information in them. For example:
SendMessage["Twitter", StringJoin@ConstantArray["a", 141]]
returns:
ServiceExecute::apierr: The service returned the following error message: {{code->186,message->Status is over 140 characters.}}.
Based on the docs for $MessageList, I assumed I could add err = $MessageList to the same cell as the SendMessage to capture the message; however err is an empty list when I do so.* Additionally, when I call MessageList[n] where n is the appropriate cell number, I get the name of the message {ServiceExecute::apierr} but not the details.
How can I go about accessing the details of the error message in this case? Another similar question has been asked; however, it's not clear to me how the answers there apply in this case. (And for completeness, another good read.)
* Executing
Plot[];err=$MessageList does populate err, but I don't know why SendMessage does not behave in the same fashion.
messages; (b) definescollectMessages(c) callsAddHandler(d) callsSendMessageand (e) callsRemoveHandler? Or, would I initializecollectMessagesand then clearmessagesbefore trying to send the tweet? I'm concerned about overhead since, ultimately, this program is being run from an RPi, making efficiency a high priority. – bobthechemist Nov 17 '14 at 02:01messages[[1]]):Hold[Message[ToExpression::sntx, "Twitter", "Privatezztop$3...` Excuse me while I find my dark sunglasses... – bobthechemist Nov 17 '14 at 02:03