Partilhar via


Speech Application Exception Handling

  Microsoft Speech Technologies Homepage

Errors in your speech application will be reported by different components of Speech Server, depending on the nature of the error. An error in server-side code, for example in data access code, will probably appear as an ASP.NET error. A client-side script error might be handled by Telephony Application Services (TAS). An error in a grammar file will be handled by Speech Engine Services (SES). All errors handled by TAS and SES are assigned an error code and logged in the application event log.

Handling Exceptions in SES

Typical exceptions in SES are due to malformed prompt markup, or errors in grammar files. These errors are handled by SES and logged with one of the codes listed in the topic Simulating Exceptions. To diagnose these errors, see the entries in the Application Event Viewer on the SES and TAS computers.

Handling Exceptions in TAS

Exceptions raised by TAS fall into two categories: either they are speech application errors or they are more serious Speech Server system errors. These two categories are handled as described in the following two sections.

Exceptions Passed to the Speech Application

If an exception occurs when RunSpeech calls an application event handler, or if RunSpeech receives an onerror event from a SALT object, it calls the DefaultErrorPage.aspx installed by Speech Application SDK. If desired, use the <appSettings> tag in the Web.config file to specify a different default error page, as shown in the following example.

<configuration>
    <appSettings>
        <add key="errorpage" value="myerrorpage.htm" />
    </appSettings>
</configuration>

System Exceptions

If a system exception occurs, TAS automatically navigates to a system error page. System exceptions include 404 errors when downloading application resources or an exception internal to TAS. The system error page is specified by adding a meta tag to an .html file. See the topic Creating a System Error Page for more information.

Handling Exceptions in the Web server

Whenever an unhandled exception occurs in the Web server, ASP.NET will display a default error page to the user. Depending on settings in the web.config file, the default error page might display error details and code. The preferred technique is to implement custom error pages which display in the browser whenever an unhandled exception occurs.

Custom error pages can be configured through Internet Information Services (IIS), or in ASP.NET through the XML-based web.config file. For information on creating custom error-handling pages in IIS, see HOW TO: Use the ASPError Object to Build a Custom Error-Handling Page in Internet Information Server, or search in IIS documentation.

See Also

Troubleshooting Resources | Debugging Speech Applications | SAPI Error Codes | Simulating Exceptions | Using a System Error Page | Global Application Settings