Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EIS - Brio Javascript - Handling Errors

Status
Not open for further replies.

sharla724

Programmer
May 15, 2001
3
0
0
US
I am asking users to enter their Oracle User ID and Password into EIS Text Boxes and then connecting using the Connection object. If the user does not enter a correct login I want to be able to access the Oracle error message and display it with an alert, so that I can let them know that they don't have a proper login or that they need to re-enter it. The Connect method returns an object, so I can't use the return value. Any suggestions would be great.

Thanks,

Sharla
 
Hi Sharla,

you should surround your connect-statement with try/catch. In case of an error the catch block is executed, where you can start an alert. It looks like that:

Code:
try {
   ...Datamodel.Connection.connect()
} catch (error)
{
   Alert(error.toString())
   // return if you like to end the method
}
[\code]

Volker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top