Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more helpful error for non-response in Action #733

Merged
merged 1 commit into from
Mar 20, 2019

Conversation

paulcsmith
Copy link
Member

Part of #460

There is still a bug that makes it so we can't show the type, but I
think we should show this error without the type. It is still better
than what is there.

Currently:

in src/lucky/renderable.cr:98: no overload matches 'Rendering::Index#handle_response' with type (Lucky::Response | Nil)
Overloads are:
 - Lucky::Renderable#handle_response(response : Lucky::Response)

    handle_response(response)
    ^~~~~~~~~~~~~~~

Rerun with --error-trace to show a complete error trace.

With this change:

in src/lucky/renderable.cr:98:
Your action returned (Lucky::Response | Nil)

But it should return a Lucky::Response.

Try this...

  ▸ Use a method like render/redirect/json at the end of your action.
  ▸ Ensure conditionals (if/else/case) at the end of your action return a response (render/redirect/json/etc.)

    handle_response(response)

Still not a helpful trace as the file is not the user's file, but at least it explains what to do a bit better

Part of #460

There is still a bug that makes it so we can't show the type, but I
think we should show this error without the type. It is still better
than what is there.
@paulcsmith paulcsmith merged commit 74762f7 into master Mar 20, 2019
@paulcsmith paulcsmith deleted the pcs/460-error-with-file branch March 20, 2019 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant