Exception: Synthra::Errors::SimulatedBehaviorError

Inherits:
Error
  • Object
show all
Defined in:
lib/synthra/errors.rb

Overview

Base class for simulated behavior errors

Simulated errors are raised intentionally by behaviors like @failure, @close_connection, and @simulate_error. They help test how consuming applications handle various failure scenarios.

Examples:

Testing error handling

begin
  api_mock.generate  # Schema has @failure 10%
rescue Synthra::SimulatedBehaviorError => e
  # This is expected - test that your app handles it correctly
  expect(app.last_error).to eq("Service unavailable")
end

Constant Summary collapse

ERROR_CODE =
"SIMULATED_BEHAVIOR_ERROR"