Module: UnixSocks::ServerError
- Defined in:
- lib/unix_socks/server_error.rb
Overview
Marker module for UnixSocks server-related errors.
This module is mixed into exceptions raised by UnixSocks server implementations to provide a common rescue clause for server-related errors.
Class Method Summary collapse
-
.build(exception, message) ⇒ Exception
Builds a server error exception with the given exception class and message.
-
.mark(e) ⇒ Exception
Marks the given exception with the ServerError module.
Class Method Details
.build(exception, message) ⇒ Exception
Builds a server error exception with the given exception class and message.
This method creates a new exception instance of the specified exception class with the provided message, marks it with the ServerError module, and returns the marked exception.
24 25 26 |
# File 'lib/unix_socks/server_error.rb', line 24 def self.build(exception, ) mark(exception.new()) end |
.mark(e) ⇒ Exception
Marks the given exception with the ServerError module.
This method extends the provided exception object with the ServerError module, effectively tagging it as a server-related error for consistent handling.
37 38 39 |
# File 'lib/unix_socks/server_error.rb', line 37 def self.mark(e) e.extend(self) end |