Exception: BetterService::Errors::Configuration::SchemaRequiredError

Inherits:
ConfigurationError show all
Defined in:
lib/better_service/errors/configuration/schema_required_error.rb

Overview

Raised when a service is missing a required schema definition

All BetterService services must define a schema block for parameter validation. This error is raised during service initialization if no schema is defined.

Examples:

Service without schema (will raise error)

class MyService < BetterService::Services::Base
  # Missing: schema do ... end
end

MyService.new(user, params: {})
# => raises SchemaRequiredError

Correct usage with schema

class MyService < BetterService::Services::Base
  schema do
    required(:name).filled(:string)
  end
end

Instance Attribute Summary

Attributes inherited from BetterServiceError

#code, #context, #original_error, #timestamp

Method Summary

Methods inherited from BetterServiceError

#backtrace, #detailed_message, #initialize, #inspect, #to_h

Constructor Details

This class inherits a constructor from BetterService::BetterServiceError