shard-crystal-db/src/db/error.cr
Brian J. Cardiff 2ca60ba43f Add ConnectionRefused exception
* required to fix retry+connection initialization corner case.
2016-12-15 14:40:56 -03:00

32 lines
677 B
Crystal

module DB
class Error < Exception
end
class MappingException < Exception
end
class PoolTimeout < Error
end
class PoolRetryAttemptsExceeded < Error
end
# Raised when an established connection is lost
# probably due to socket/network issues.
# It is used by the connection pool retry logic.
class ConnectionLost < Error
getter connection : Connection
def initialize(@connection)
end
end
# Raised when a connection is unable to be established
# probably due to socket/network or configuration issues.
# It is used by the connection pool retry logic.
class ConnectionRefused < Error
end
class Rollback < Exception
end
end