How to validate a flight number ?

I am using the FlightInfo method in coldfusion to return the results for the flight number entered.
If I enter a wrong or invalid flight number it gives the following error

" 500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed. "
And the error is in the line
aFlightInfoStruct = ws.FlightInfo(stFlightInfo);

My questions here are

  1. Is there a method that validates the flight number ?
  2. How to avoid the internal sever error ?

Please help me solve this

Thanks in advance

That is correct. The ident passed to FlightInfo is validated and an error returned if the check fails. You can use the error itself as an indicator of a bad ident or you can get your ident from another method such as Enroute, Scheduled, AirlineFlightSchedules to ensure you have a valid one. Hard to say a best solution without a better understanding of the app workflow.