Exception Handling System Preventing Corrupted State Catching

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing exception handling systems often lead to developers catching broad classes of exceptions, which can result in improper handling of corrupted application state exceptions, leading to unpredictable results and potential program corruption.

Innovation Solution

An exception handling system that distinguishes 'hard to catch' exceptions, such as those that corrupt application state, by requiring developers to explicitly acknowledge and handle them through the use of a custom attribute, preventing default catching and encouraging correct programming practices.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If developers use broad exception catching (e.g., catch all exceptions), then exception handling coverage is improved, but the risk of improper handling and program corruption increases

Engineering Contradiction:
Improveexception handling coverageVSAvoidprogram corruption risk
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

Solution Approach 1:

The patent segments exceptions into two distinct categories: corrupted state exceptions and non-corrupted exceptions. This segmentation is achieved through a special attribute that marks certain exceptions as indicating corrupted application state. The segmentation allows the system to apply different handling rules to different exception types, preventing broad catching of corrupted state exceptions while allowing comprehensive handling of safe exceptions.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent inverts the traditional exception handling approach by preventing catching of corrupted state exceptions by default, rather than allowing all exceptions to be caught. This inversion requires developers to explicitly opt-in to catching corrupted state exceptions through special attributes, thereby reversing the default behavior from permissive to restrictive and eliminating the harmful effect of improper handling.

Inventive Principle:
Principle #13The other way round (Inversion)

2Reliability

If developers are prevented from catching corrupted state exceptions, then program stability is improved, but the ability to handle legitimate exceptions is reduced

Engineering Contradiction:
Improveprogram stabilityVSAvoidexception handling flexibility
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent applies preliminary action by marking functions with special attributes before they are executed, indicating their ability to handle corrupted state exceptions. This preliminary marking allows the exception handling system to identify and deliver corrupted state exceptions to appropriate handlers in advance, ensuring that functions capable of proper handling can still receive and process these exceptions while maintaining program stability.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent implements feedback through the attribute system that provides information about a function's capability to handle corrupted state exceptions. This feedback mechanism allows the exception handling system to make informed decisions about exception delivery, ensuring that exceptions are routed to functions that have demonstrated through attributes their ability to handle them properly, thus maintaining both stability and flexibility.

Inventive Principle:
Principle #23Feedback

3Loss of information

If the system delivers all exceptions to catch blocks, then complete exception information is available, but the likelihood of incorrect handling increases

Engineering Contradiction:
Improveexception information completenessVSAvoidhandling correctness
Core Design Contradiction:
Loss of informationVSReliability

Solution Approach 1:

The patent segments the exception delivery process based on exception type and handler capability. Corrupted state exceptions are separated from other exceptions and delivered only to handlers that have been marked with special attributes indicating their ability to handle such exceptions. This segmentation ensures that complete exception information is available to appropriate handlers while preventing incorrect handling by unprepared catch blocks.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS10346199B2Handling exceptions related to corrupt application state
Publication Date: 2019.07.09 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10346199B2 patent drawing
  • US10346199B2 patent drawing
  • US10346199B2 patent drawing

AI summary

An exception handling system is described herein that provides one or more distinguished classes of software exceptions that are handled differently than other exceptions. The system treats a distinguished exception as a “hard to catch” exception that is not passed to the catch block of program code unless a developer performs extra steps to acknowledge the distinguished nature of the exception and confirm that the program code is prepared to properly handle the exception. Exceptions that fall into this class are typically those that represent conditions from which normal exception handling practices cannot successfully recover, namely exceptions that corrupt application state. Accordingly, the system prevents the developer from catching these classes of exceptions by default unless the developer explicitly requests to have these exceptions delivered to the program code. Thus, the exception handling system encourages correct programming practices by preventing developer error by default.