-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Jaoow/fix/exceptions
🐛 Fixing error calls.
- Loading branch information
Showing
7 changed files
with
67 additions
and
53 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
connector/src/main/java/com/jaoow/sql/connector/ConnectionConsumer.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,22 @@ | ||
package com.jaoow.sql.connector; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
|
||
/** | ||
* This is a functional interface that accepts the {@link Connection} without | ||
* needing to handle the {@link SQLException} error. | ||
*/ | ||
@FunctionalInterface | ||
public interface ConnectionConsumer { | ||
|
||
/** | ||
* Performs this operation with the @{@link Connection}. | ||
* | ||
* @param connection The @{@link Connection}. | ||
*/ | ||
void execute(@NotNull Connection connection) throws SQLException; | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
connector/src/main/java/com/jaoow/sql/connector/ConnectorException.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,26 @@ | ||
package com.jaoow.sql.connector; | ||
|
||
import lombok.NonNull; | ||
|
||
/** | ||
* Custom exception for throwing connector exceptions at runtime. | ||
*/ | ||
public class ConnectorException extends RuntimeException { | ||
|
||
/** | ||
* Constructs a new connector runtime exception with null cause. | ||
*/ | ||
public ConnectorException() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Constructs a new connector runtime exception. | ||
* | ||
* @param cause The cause. | ||
*/ | ||
public ConnectorException(@NonNull Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
} |
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
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