What is 1359 (0x0000054F)

 
Previous Next
ERROR_INTERNAL_DB_CORRUPTION ERROR_GENERIC_NOT_MAPPED

ERROR_INTERNAL_ERROR

This error (ERROR_INTERNAL_ERROR) is returned by the application code when no error code is defined (or the programmer has not found) that would more accurately describe the problem that occurred. Typically, such an error code (1359) is generated by a section of code that, in the opinion of the developer, should never be executed. The result is usually deplorable. If you did not see the application crash, then you are a very lucky man.

Internal errors are due to faulty logic or coding in the program. Common types of internal errors include:

  • Bounds errors;
  • Inserting a null pointer into a collection;
  • Attempting to use a bad date.

All of these errors should be preventable. For example, you always know the permissible range of indices for an array, so you can probably avoid a bounds error. You would correct your program's use of a bad date as an obvious logic error.

Internal errors can be further classified according to the cost of error detection, and whether or not the error will be detected at run time. The two categories are:

  • Non-recoverable internal errors;
  • Recoverable internal errors.

Non-recoverable Internal Errors

Non-recoverable internal errors share the following distinguishing characteristics. They are:

  • Easily predicted in advance;
  • Encountered at relatively low levels;
  • Costly to detect;
  • Detected only in the debug version of the library.

Non-recoverable internal errors by definition have no recovery mechanism. Examples of these errors include bounds errors, and inserting a null pointer into a collection.

Why does a library define some errors as unrecoverable? Because detecting errors takes time. For performance reasons, a library demands some minimal level of correctness on the part of your program, and pitches anything that falls short. Errors are non-recoverable in the sense that the production version of the library has no mechanism for detecting such errors and, hence, no opportunity for recovering from them.

Bounds errors are non-recoverable because the cost of checking to make sure an index is in range can well exceed the cost of the array access itself. If a program does a lot of array accesses, checking every one may result in a slow program. To avoid this, the library may require you to always use a valid index. Because a minimum level of correctness is demanded, non-recoverable errors are simple in concept and relatively easy to avoid.