Announcement

Collapse
No announcement yet.

Trapping MvCALL error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trapping MvCALL error



    Hello experts.

    I want to call a page by MvCALL - different server, maybe an .htm maybe an
    .asp. If the page is there and I can get to it I would like it to display,
    hence <MvEVAL EXPR="{callvalue}">

    But if the page is gone or unavailable I want it to generate a handlable
    variable (err1) and NOT show the error message and not kill the script.

    I've tried 20 variations of the below code (more, less, different). I don't
    do a lot of error trapping and this seems to be getting the best of me. Any
    help out there. (this is non-compiled by the way).

    Thanks

    Keith
    [email protected]



    <MIVA ERROROUTPUTLEVEL="runtime"
    ERRORMESSAGE="NOFILE ERROR">
    <MIVA MvCALL_ERROR="nonfatal,nondisplay">

    <MvCALL
    ACTION=<A HREF ="http://www.pageIwant tofind.com/dosomething.htm">http://www.pageIwant tofind.com/dosomething.htm</A>
    METHOD="post">
    <MvEVAL EXPR="{callvalue}">
    </MvCALL>

    <MvIF EXPR="{ MvCALL_ERROR NE '' }">
    <MvASSIGN NAME="err1" VALUE="1">
    </MvIF>

    <MvIF EXPR="{ err1 EQ '1' }">
    ....


    #2
    Trapping MvCALL error



    Hi Keith,

    You had a typo (nondisplay instead of nodisplay)

    Try this (I used a non-existant domain for testing):

    <MIVA MvCALL_ERROR="nonfatal,nodisplay">

    <MvCALL ACTION = "<A HREF ="http://www.tyrinth6.org" METHOD = "get" FIELDS = "">">http://www.tyrinth6.org" METHOD = "get" FIELDS = ""></A>
    </MvCALL>

    <MvIF EXPR="{ MvCALL_ERROR }">
    ERROR ERROR!



    </MvIF>

    Scot

    Avant Solutions - Hosting and Development
    <A HREF ="http://www.avantsolutions.com">http://www.avantsolutions.com</A>

    ----- Original Message -----
    From: "Creative" <[email protected]>
    To: <[email protected]>
    Sent: Thursday, June 27, 2002 3:38 PM
    Subject: [meu] Trapping MvCALL error


    > Hello experts.
    >
    > I want to call a page by MvCALL - different server, maybe an .htm maybe an
    > .asp. If the page is there and I can get to it I would like it to
    display,
    > hence <MvEVAL EXPR="{callvalue}">
    >
    > But if the page is gone or unavailable I want it to generate a handlable
    > variable (err1) and NOT show the error message and not kill the script.
    >
    > I've tried 20 variations of the below code (more, less, different). I
    don't
    > do a lot of error trapping and this seems to be getting the best of me.
    Any
    > help out there. (this is non-compiled by the way).
    >
    > Thanks
    >
    > Keith
    > [email protected]
    >
    >
    >
    > <MIVA ERROROUTPUTLEVEL="runtime"
    > ERRORMESSAGE="NOFILE ERROR">
    > <MIVA MvCALL_ERROR="nonfatal,nondisplay">
    >
    > <MvCALL
    > ACTION=<A HREF ="http://www.pageIwant tofind.com/dosomething.htm">http://www.pageIwant tofind.com/dosomething.htm</A>
    > METHOD="post">
    > <MvEVAL EXPR="{callvalue}">
    > </MvCALL>
    >
    > <MvIF EXPR="{ MvCALL_ERROR NE '' }">
    > <MvASSIGN NAME="err1" VALUE="1">
    > </MvIF>
    >
    > <MvIF EXPR="{ err1 EQ '1' }">
    > ....
    >

    Comment


      #3
      Trapping MvCALL error



      Hi Keith,

      One simple way is to include into the MvCALL a condition that triggers an
      MvCALLSTOP when a server error occurs, a bit like this :

      <MvASSIGN NAME="err1" VALUE="">
      <MvCALL
      ACTION=<A HREF ="http://www.pageIwant tofind.com/dosomething.htm">http://www.pageIwant tofind.com/dosomething.htm</A>
      METHOD="post">

      <MvIF EXPR="{ 'HTTP 404' CIN callvalue OR 'HTTP 500' CIN ....
      etc.etc.etc. }">
      <MvASSIGN NAME="err1" VALUE="1">
      <MvCALLSTOP>
      <MvELSE>
      <MvASSIGN NAME="g.pagecontent" VALUE="{g.pagecontent$callvalue }">
      </MvIF>

      </MvCALL>

      <MvIF EXPR="{ NOT err1 }">
      <MvEVAL EXPR="{ g.pagecontent}">
      </MvIF>



      Markus





      -----Original Message-----
      From: [email protected] [mailto:[email protected]]On
      Behalf Of Creative
      Sent: Thursday, June 27, 2002 6:39 PM
      To: [email protected]
      Subject: [meu] Trapping MvCALL error


      Hello experts.

      I want to call a page by MvCALL - different server, maybe an .htm maybe an
      .asp. If the page is there and I can get to it I would like it to display,
      hence <MvEVAL EXPR="{callvalue}">

      But if the page is gone or unavailable I want it to generate a handlable
      variable (err1) and NOT show the error message and not kill the script.

      I've tried 20 variations of the below code (more, less, different). I don't
      do a lot of error trapping and this seems to be getting the best of me. Any
      help out there. (this is non-compiled by the way).

      Thanks

      Keith
      [email protected]



      <MIVA ERROROUTPUTLEVEL="runtime"
      ERRORMESSAGE="NOFILE ERROR">
      <MIVA MvCALL_ERROR="nonfatal,nondisplay">

      <MvCALL
      ACTION=<A HREF ="http://www.pageIwant tofind.com/dosomething.htm">http://www.pageIwant tofind.com/dosomething.htm</A>
      METHOD="post">
      <MvEVAL EXPR="{callvalue}">
      </MvCALL>

      <MvIF EXPR="{ MvCALL_ERROR NE '' }">
      <MvASSIGN NAME="err1" VALUE="1">
      </MvIF>

      <MvIF EXPR="{ err1 EQ '1' }">
      ....

      Comment

      Working...
      X