Having it in clover_error.rb file breaks autoloading and reloading. If you modified the clover_error.rb file while puma was running in development mode, you would get the following error: ``` Puma caught this error: superclass mismatch for class DependencyError (TypeError) /home/jeremy/code/ubicloud/clover_error.rb:14:in `<top (required)>' ``` This uses a separate file per class, and moves the files to the lib folder. This avoids cluttering the root folder, and makes the loader simpler.
13 lines
242 B
Ruby
13 lines
242 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CloverError < StandardError
|
|
attr_reader :code, :type, :details
|
|
def initialize(code, type, message, details = nil)
|
|
@code = code
|
|
@type = type
|
|
@details = details
|
|
|
|
super(message)
|
|
end
|
|
end
|