Skip to content

Commit

Permalink
Flip around the error text
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcsmith committed Jul 10, 2021
1 parent 6223aa9 commit 7fe8cfa
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/lucky/routable.cr
Original file line number Diff line number Diff line change
Expand Up @@ -156,27 +156,19 @@ module Lucky::Routable

{% if already_used_route = NORMALIZED_ROUTES.find { |route| route[:normalized_path] == normalized_path && route[:method] == method } %}
{% raise <<-ERROR
#{already_used_route[:original_path]} in '#{already_used_route[:action]}' collides with the route in '#{@type.name}'
#{original_path} in '#{@type.name}' collides with the path in '#{already_used_route[:action]}'
Try this...
▸ Change the paths in one of the actions to something unique
Or, skip the uniqueness check
# Only do this if you are sure the route is actually unique
# Only do this if you are sure the route is unique
class #{@type.name}
+ include Lucky::SkipUniqueRouteCheck
end
Or, skip checking all actions by adding 'Lucky::SkipUniqueRouteCheck'
# Add to both BrowserAction and ApiAction
# Only do this if you are sure the route is actually unique
class BrowserAction/ApiAction
- include Lucky::SkipUniqueRouteCheck
end
ERROR
%}
Expand Down

0 comments on commit 7fe8cfa

Please sign in to comment.