diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-20 18:47:45 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-20 18:47:45 +0300 |
| commit | 70fc0505b223f7bf17d3671d0532773359cf7858 (patch) | |
| tree | 1c244371e6a4e89e7694d5691db6a14b0ba2da06 /src/main/java/exceptions/VSSimulatorRuntimeException.java | |
| parent | f6d2a6bbbc37c552accf91a13ccd6ea45ecf8e73 (diff) | |
Implement proper exception hierarchy and consistent error handling
- Create base exception classes:
- VSSimulatorException: Base checked exception for all simulator errors
- VSSimulatorRuntimeException: Base unchecked exception for unrecoverable errors
- Refactor existing exceptions to extend from base class:
- VSEventNotCopyableException: Now includes better error messages
- VSParseIntegerVectorException: Added constructors with cause support
- VSNegativeNumberException: Added field name and value parameters
- Add new specific exception types:
- VSConfigurationException: For configuration errors
- VSSerializationException: For save/load operations
- VSProcessException: For process-related errors
- VSProtocolException: For protocol execution errors
- Create VSErrorHandler utility class:
- Centralized error logging and user notification
- Consistent error handling patterns
- Helper methods for warning and error dialogs
- Update exception handling in code:
- VSClassLoader: Better error messages and specific exception handling
- Timestamp events: Catch RuntimeException for custom actions
- All 132 unit tests pass
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'src/main/java/exceptions/VSSimulatorRuntimeException.java')
| -rw-r--r-- | src/main/java/exceptions/VSSimulatorRuntimeException.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main/java/exceptions/VSSimulatorRuntimeException.java b/src/main/java/exceptions/VSSimulatorRuntimeException.java new file mode 100644 index 0000000..59acac9 --- /dev/null +++ b/src/main/java/exceptions/VSSimulatorRuntimeException.java @@ -0,0 +1,47 @@ +package exceptions; + +/** + * Base runtime exception class for DS-Sim simulator. + * Used for unrecoverable errors that should not be caught in normal flow. + * + * @author Paul C. Buetow + */ +public class VSSimulatorRuntimeException extends RuntimeException { + /** The serial version uid */ + private static final long serialVersionUID = 1L; + + /** + * Constructs a new simulator runtime exception with null as its detail message. + */ + public VSSimulatorRuntimeException() { + super(); + } + + /** + * Constructs a new simulator runtime exception with the specified detail message. + * + * @param message the detail message + */ + public VSSimulatorRuntimeException(String message) { + super(message); + } + + /** + * Constructs a new simulator runtime exception with the specified detail message and cause. + * + * @param message the detail message + * @param cause the cause + */ + public VSSimulatorRuntimeException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Constructs a new simulator runtime exception with the specified cause. + * + * @param cause the cause + */ + public VSSimulatorRuntimeException(Throwable cause) { + super(cause); + } +}
\ No newline at end of file |
