I am using the WolframAlpha
command to automated solution sets of homework exercises. Here is an sample usage, although this can happen with many different examples:
WolframAlpha["limit (1 + k)^10/(10*k^10) as k -> Infinity", {{"Limit", 2}, "Content"}, PodStates -> {"Limit__Step-by-step solution"}]
Every so often, I receive the error message:
XML`Parser`XMLGetString::prserr: The main XML document cannot be empty at Line: 6 Character: 1.
When I reissue the command, it returns fine. That would seem to indicate that it is a timeout issue. OTOH, using the TimeConstraint
option returns a different message.
Therefore, I would like to know what causes this, in order to build a workaround. Alternatively, to know (programmatically) that it happened (in some error value), in order to reissue the command.
TYVM.
TimeConstrained
returns a different error does not surprise me, since the failure mode becomes different (your code is aborted locally rather than failing). $\endgroup$WolframAlpha
returns aRawBoxes
object when the call works. I could not reproduce the error, so I don't know what would be returned in that case (maybe$Failed
?), but you could check for an unexpectedHead
in the return value. Maybe wrapwa = WolframAlpha[...]
inWhile
and re-evaluate it untilHead[wa]
returnsRawBoxes
? $\endgroup$Apart[(1 + k)^10/(10*k^10)]
much clearer in illustrating why the limit is $1/10$ than the explanation given by W|A. $\endgroup$Head
and it equaled:Missing
. Thanx again. $\endgroup$