Class DataAccessException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.ntu.fdae.group1.bto.exceptions.DataAccessException
- All Implemented Interfaces:
Serializable
Exception thrown when there are issues accessing or manipulating data in
repositories.
This exception serves as a wrapper for various data-related errors that might occur during repository operations, such as: - File I/O errors when reading from or writing to persistent storage - Data format errors when parsing stored data - Consistency errors when data violates integrity constraints - Network errors when accessing remote data sources
By using this exception consistently across repositories, the application can handle data access errors in a uniform way in higher layers.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDataAccessException
(String message) Constructs a new DataAccessException with a detailed message.DataAccessException
(String message, Throwable cause) Constructs a new DataAccessException with a detailed message and cause.DataAccessException
(Throwable cause) Constructs a new DataAccessException with a cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
DataAccessException
Constructs a new DataAccessException with a detailed message.- Parameters:
message
- The detail message explaining the error
-
DataAccessException
Constructs a new DataAccessException with a detailed message and cause.This constructor is useful when wrapping lower-level exceptions that occurred during data access operations.
- Parameters:
message
- The detail message explaining the errorcause
- The underlying cause of this exception
-
DataAccessException
Constructs a new DataAccessException with a cause.This constructor is useful when rethrowing an existing exception that doesn't fit the standard exception hierarchy.
- Parameters:
cause
- The underlying cause of this exception
-