Skip to content

Commit

Permalink
fix: use left instead of fail internally (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
seuros authored Sep 26, 2024
1 parent 3765f08 commit 271b141
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/trailblazer/finder/activities/prepare_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def set_entity(ctx, config:, **)
end

step :validate_entity
fail :invalid_entity_error
left :invalid_entity_error
step :set_entity
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/trailblazer/finder/activities/prepare_filters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def set_filters(ctx, config:, **)
end

step :validate_filters
fail :invalid_filters_error
left :invalid_filters_error
step :set_filters
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/trailblazer/finder/activities/prepare_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def set_params(ctx, **)
end

step :validate_params
fail :invalid_params_error
left :invalid_params_error
step :set_params
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/trailblazer/finder/activities/prepare_properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def set_properties(ctx, config:, **)

step :check_property_types
step :validate_property_types
fail :invalid_properties_error
left :invalid_properties_error
step :set_properties
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/trailblazer/finder/activities/process_adapters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def invalid_paginator_handler(_e, (ctx, _flow_options), **)
step :set_adapter, fast_track: true
step Rescue(Dry::Types::ConstraintError, handler: :invalid_paginator_handler) {
step :set_paginator
fail :invalid_paginator_error
left :invalid_paginator_error
}
end
end
Expand Down
1 change: 1 addition & 0 deletions trailblazer-finder.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "dry-types", ">= 1.0.0"
spec.add_dependency "trailblazer-macro", ">= 2.1.15"
spec.add_dependency "trailblazer-activity", ">= 0.13.0"
spec.add_dependency "trailblazer-activity-dsl-linear", ">= 1.2.5"
spec.add_dependency "zeitwerk", ">= 2.6.0"

spec.add_development_dependency "activerecord"
Expand Down

0 comments on commit 271b141

Please sign in to comment.