usererr $message, key => $value, key => $value

Shorthand notation to create a UserError, to inform the user they did something wrong. First argument is a scalar of text (or a RawHtml scalar of html) Second through N arguments are hash keys to apply to the UserError constructor.

Examples: # To throw a message to the user with no data and no error report: die usererr "Hey you moron, don't do that";

  # To specify that your message is html already:
  die usererr rawhtml "<h2>Hell Yeah</h2>";

userexception $message, key => $value, key => $value, \%data

Shorthand notation for creating a RapidApp::Error which also informs the user about why the error occured. First argument is the message displayed to the user (can be a RawHtml object). Last argument is a hash of data that should be saved for the error report. ( the last argument is equivalent to a value for an implied hash key of "data" )


  # Die with a custom user-facing message (in plain text), and a title made of html.
  die userexception "Description of what shouldn't have happened", title => rawhtml "<h1>ERROR</h1>";
  # Capture some data for the error report, as we show this message to the user.
  die userexception "Description of what shouldn't have happened", $some_debug_info;