The line number displayed may not always be where the actual error originated.
错误消息中显示的行号不一定是出现错误的实际位置。
This construct is used to return to the calling application the actual error that caused the statement to fail, as shown in Listing 17.
该结构用于将实际的错误返回给调用应用程序,这个错误致使语句执行失败,如清单17所示。
As an alternative, you can catch this exception directly in your code and handle it some other way (perhaps printing out the actual error message along with usage information, for instance).
一个替代的方法是,您也可以在代码中直接捕捉这个异常,并且用其他方式处理异常(例如,可能会与使用信息一起输出真正的错误消息)。
应用推荐