diff --git a/CHANGELOG.md b/CHANGELOG.md index 94983377bd..c7c535be5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,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 diff --git a/dash/dash.py b/dash/dash.py index 71ae894a24..54fc4c9be5 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -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