summaryrefslogtreecommitdiff
path: root/src/main/java/events/implementations/VSLamportTimestampEvent.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-20 18:47:45 +0300
committerPaul Buetow <paul@buetow.org>2025-06-20 18:47:45 +0300
commit70fc0505b223f7bf17d3671d0532773359cf7858 (patch)
tree1c244371e6a4e89e7694d5691db6a14b0ba2da06 /src/main/java/events/implementations/VSLamportTimestampEvent.java
parentf6d2a6bbbc37c552accf91a13ccd6ea45ecf8e73 (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/events/implementations/VSLamportTimestampEvent.java')
-rw-r--r--src/main/java/events/implementations/VSLamportTimestampEvent.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/events/implementations/VSLamportTimestampEvent.java b/src/main/java/events/implementations/VSLamportTimestampEvent.java
index 272ea06..28da7dc 100644
--- a/src/main/java/events/implementations/VSLamportTimestampEvent.java
+++ b/src/main/java/events/implementations/VSLamportTimestampEvent.java
@@ -73,8 +73,10 @@ public class VSLamportTimestampEvent extends VSTimestampTriggeredEvent {
if (customAction != null) {
try {
customAction.run();
- } catch (Exception e) {
+ } catch (RuntimeException e) {
+ // Log the error but don't let it stop the event processing
internalProcess.log("Error executing custom action: " + e.getMessage());
+ exceptions.VSErrorHandler.warning("Lamport timestamp event custom action failed", e);
}
}