plotly / dash

Data Apps & Dashboards for Python. No JavaScript Required.
https://plotly.com/dash
MIT License
20.95k stars 2.02k forks source link

Bare Exceptions #304

Open T4rk1n opened 6 years ago

T4rk1n commented 6 years ago

Currently, there is a couple bare Exception that are raised by dash, they should be refactored into appropriate DashException.

Should be a TypeError or NoLayoutException: https://github.com/plotly/dash/blob/54ca4a376ec349639da5140f1e2c42a739815626/dash/dash.py#L197-L203

A new exception type InvalidIndexException: https://github.com/plotly/dash/blob/54ca4a376ec349639da5140f1e2c42a739815626/dash/dash.py#L224-L229

https://github.com/plotly/dash/blob/54ca4a376ec349639da5140f1e2c42a739815626/dash/dash.py#L409-L415

A new exception type DependencyException: https://github.com/plotly/dash/blob/54ca4a376ec349639da5140f1e2c42a739815626/dash/dash.py#L357-L374

ResourceException ?: https://github.com/plotly/dash/blob/54ca4a376ec349639da5140f1e2c42a739815626/dash/resources.py#L42-L48

ned2 commented 5 years ago

@shammamah, just spotted one that slipped through. Sorry to be a bit late before you merged the PR. On line 400:

raise Exception(
    'Serving files from absolute_path isn\'t supported yet'
)

Perhaps NotImplementedException or NotSupportedYetExcpetion