Skip to content

Commit

Permalink
Use missing_field_error
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Oct 4, 2024
1 parent 39f1780 commit 54ade4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/floe/workflow/states/map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Map < Floe::Workflow::State
def initialize(workflow, name, payload)
super

raise Floe::InvalidWorkflowError, "Missing \"InputProcessor\" field in state [#{name.last}]" if payload["ItemProcessor"].nil?
missing_field_error!("InputProcessor") if payload["ItemProcessor"].nil?

@next = payload["Next"]
@end = !!payload["End"]
Expand Down
2 changes: 1 addition & 1 deletion spec/workflow/states/map_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}

expect { make_workflow(ctx, payload) }
.to raise_error(Floe::InvalidWorkflowError, "Missing \"InputProcessor\" field in state [Validate-All]")
.to raise_error(Floe::InvalidWorkflowError, "States.Validate-All does not have required field \"InputProcessor\"")
end

it "raises an InvalidWorkflowError with a missing Next and End" do
Expand Down

0 comments on commit 54ade4b

Please sign in to comment.