且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是“内部错误"?我该如何解决?

更新时间:2022-05-13 05:19:14

编程工具必须报告程序中的错误,例如代码中的语法错误、运行时的运行时错误以及测试时的测试失败,所以你可以修复你的代码.但是该编程工具本身是一个计算机程序,因此本身可能存在错误.复杂程序的细心程序员包括自我检查以检测未知错误的后果.如果其中一个自检失败,程序员将安排程序报告有关自检失败的信息.为了防止将您的代码中的错误与工具本身中的错误混淆,通常将工具本身中的错误称为内部错误.

The programming tool has to report errors in your program, such as syntax errors in your code, runtime errors when you run it, and test failures when you test it, so you can fix your code. But that programming tool is itself a computer program, and so itself can have bugs in it. Careful programmers of complicated programs include self-checks to detect the consequences of unknown bugs. If one of those self-checks fails, the programmer will have arranged for the program to report information about the failed self-check. To prevent confusion between errors in your code and errors in the tool itself it is conventional to call the error in the tool itself an internal error.

在许多编程语言中,自检是使用 ,有关失败的信息以 .

In many programming languages, self-checks are done using assertions, and information about the failure is provided in the form of a stack-trace.

那么,您如何修复内部错误?你不能.错误不在您的代码中.只有编程工具的开发者才能修复它.但这并不意味着您无能为力.

So, how do you fix an internal error? You can't. The error is not in your code. Only the developer of the programming tool can fix it. But that does not mean there is nothing you can do.

  • 如果您使用的是旧版本的编程工具,则该工具的较新版本可能已解决了该问题.因此,请考虑更新或升级您的编程工具.

  • If you are using an old version of the programming tool, it is possible that a newer version of the tool has fixed the problem. Therefore consider updating or upgrading your programming tool.

如果您的代码使用了不寻常的或新的编程结构,则可能是该工具存在问题因为这些结构是新的或不寻常的,因此没有相关的通过频繁使用发现并消除错误.因此,请考虑重写您的代码,不要在似乎触发内部错误的代码部分使用任何不寻常或新的编程结构.

If your code is making use of unusual or new programming constructs, it may be that the tool has the problem because the constructs are new or unusual, and so have not had the related bugs detected and eliminated by frequent use. Therefore consider rewriting your code not to use any unusual or new programming constructs in the section of your code that seems to have triggered the internal error.

如果您使用的是最新版本的编程工具,请考虑向该工具的开发人员提交错误报告.

If you are using an up to date version of the programming tool, consider submitting a bug report to the developers of the tool.