Skip to main content
Participant
June 14, 2006
Answered

Custom Error Messages

  • June 14, 2006
  • 1 reply
  • 371 views
I would like to use custom error messages with my server side actionscript. Is there a way to do this?
    This topic is closed to new replies. Start a new post to keep the conversation going.
    Correct answer widaph1
    Solved my own problem, here's an example:

    function InvalidCredentialsException () {
    this.message = "The username and password do not match any records in the system.";
    this.toString = function () {
    return this.message;
    };
    }

    try {
    throw new InvalidCredentialsException();
    } catch (e) {
    if (e instanceof InvalidCredentialsException) {
    ...
    }
    }

    1 reply

    widaph1AuthorCorrect answer
    Participant
    June 14, 2006
    Solved my own problem, here's an example:

    function InvalidCredentialsException () {
    this.message = "The username and password do not match any records in the system.";
    this.toString = function () {
    return this.message;
    };
    }

    try {
    throw new InvalidCredentialsException();
    } catch (e) {
    if (e instanceof InvalidCredentialsException) {
    ...
    }
    }