www.webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home Resources API Reference Mojo.assert(expression, message, messageProperties)

Mojo.assert(expression, message, messageProperties)

Writes an error to the log if expression doesn't evaluate to true.

Mojo.require and Mojo.assert methods are very similar.  The difference is that Mojo.require methods will throw an exception when their requirements aren't met, and are intended to be used in cases where the application cannot reasonably continue if the requirements aren't met.

Returns String containing the error message written to the log.

Parameter Type Description
expression Expression Expression that must evaluate to true.
message String Custom message to use if the assertion fails. Message will be run through template evaluation against messageProperties so you can include details of the assertion failure in the message.
messageProperties Object Object containing values to use with template evaluation.

 

0 Comments

    Add Comment


      • >:o
      • :-[
      • :'(
      • :-(
      • :-D
      • :-*
      • :-)
      • :P
      • :\
      • 8-)
      • ;-)