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

Improve error message #1448

Merged
merged 4 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ This project adheres to [Semantic Versioning](https://semver.org/).
### Fixed
- [#1434](https://github.com/plotly/dash/pull/1434) Fix [#1432](https://github.com/plotly/dash/issues/1432) for Julia to import non-core component packages without possible errors.

### Changed
- [#1448](https://github.com/plotly/dash/pull/1448) Provide a hint in the callback error when the user forgot to make `app.callback(...)` a decorator.

## [1.16.3] - 2020-10-07
### Fixed
- [#1426](https://github.com/plotly/dash/pull/1426) Fix a regression caused by `flask-compress==1.6.0` causing performance degradation on server requests
Expand Down
6 changes: 5 additions & 1 deletion dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,11 @@ def dispatch(self):

args = inputs_to_vals(inputs + state)

func = self.callback_map[output]["callback"]
try:
func = self.callback_map[output]["callback"]
except KeyError:
msg = "Callback function not found for output '{}', perhaps you forgot to prepend the '@'?"
raise KeyError(msg.format(output))
response.set_data(func(*args, outputs_list=outputs_list))
return response

Expand Down