forked from deephaven/deephaven-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce TableInitializationException to Propagate JobScheduler Fail…
…ures (deephaven#5165)
- Loading branch information
1 parent
8875f66
commit 1ef397c
Showing
5 changed files
with
82 additions
and
97 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
engine/api/src/main/java/io/deephaven/engine/exceptions/TableInitializationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
*/ | ||
package io.deephaven.engine.exceptions; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* An {@link UncheckedTableException} derivative which indicates a table was unable to be initialized for one reason or | ||
* another. | ||
*/ | ||
public class TableInitializationException extends UncheckedTableException { | ||
|
||
public TableInitializationException(String reason, Throwable cause) { | ||
super(reason, cause); | ||
} | ||
|
||
public TableInitializationException(@NotNull String tableDescription, @Nullable String reason) { | ||
super(makeDescription(tableDescription, reason)); | ||
} | ||
|
||
public TableInitializationException(@NotNull String tableDescription, @Nullable String reason, | ||
Throwable cause) { | ||
super(makeDescription(tableDescription, reason), cause); | ||
} | ||
|
||
private static String makeDescription(@NotNull String tableDescription, @Nullable String reason) { | ||
final StringBuilder sb = new StringBuilder(); | ||
|
||
sb.append("Error while initializing ").append(tableDescription); | ||
|
||
if (reason != null && !reason.isEmpty()) { | ||
sb.append(": ").append(reason); | ||
} | ||
|
||
return sb.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters