Glossary Updates12 new terms added to the glossaries · October 2, 2026, 22:44 CEST
AI TechDocKnowledge

Glossary · Automation software engineering and architecture

Exception (software)

Also known as: Exception, Runtime exception

German: Ausnahme

In programming, an exception is an event during program execution that disrupts the normal flow, such as division by zero, an invalid memory access or a failed operation, and that is signaled by transferring control to a handler instead of continuing with the next statement.

  • Software engineering

In one sentence

An exception is a runtime event, such as division by zero or a failed operation, that transfers control to a handler.

Example

A division by zero in a scaling function raises an exception on the controller; without a handler, the runtime stops the PLC program and switches the controller to stop mode.

How it applies

  • Engineering: Languages such as C++, C#, Java and Python use exceptions as a structured error mechanism. On controllers, processor exceptions or runtime errors, such as array index violations, may stop the program unless handled by a configured error task or handler.
  • Operation: How a controller reacts to an unhandled exception, stopping, continuing or entering a defined state, must be known and appropriate for the machine. A stopped controller does not automatically mean a safe machine; safety functions are implemented separately.
  • Documentation: Document the runtime's exception behavior and diagnostic messages in service documentation, and list the exceptions an API can raise in reference documentation.

Exception vs. error code

An error code is returned by a function and must be checked explicitly by the caller. An exception propagates automatically until a handler catches it. Exceptions make errors harder to ignore but can hide control flow; many embedded coding standards restrict their use for timing and predictability reasons.

By knowledge.aitechdoc.world · Published September 26, 2026 · Last reviewed

Source: AI TechDoc Knowledge editorial definition, based on programming language practice

Definitions follow the cited standards and specifications. Where a source is a copyrighted publication, such as an ISO, IEC or EN standard, the definition is a close paraphrase, not a verbatim quotation, so as not to infringe copyright. We recommend reading the original publication. The sections “How it applies” are editorial commentary by AI TechDoc Knowledge and are not part of any standard.

Seen a mistake? Send us a note!