170
seCure develoPment For mobIle APPs
passing information up the call stack to a handler. Here is a list of the Exception class’
members.
• getCo de(). e exception code.
• getMessage(). e exception message.
• getFile(). e file name from where the exception was thrown.
• getLine(). e line number where the exception was thrown.
• getTrace(). An array of call stack information.
• getTraceAsString(). Call stack information as a string.
• getPrevious(). Exception thrown before the current one, if present.
• _ _toString(). Entire exception as a string.
An example of using exceptions is in validating data for other objects. In this case,
an AccountMember object requires names to be strings fewer than 40 characters
in length, and not integers. W ...