-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
featuresomething newsomething new
Description
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
:
Lines 197 to 203 in 54ca4a3
if (not isinstance(value, Component) and | |
not isinstance(value, collections.Callable)): | |
raise Exception( | |
'' | |
'Layout must be a dash component ' | |
'or a function that returns ' | |
'a dash component.') |
A new exception type InvalidIndexException
:
Lines 224 to 229 in 54ca4a3
if missing: | |
raise Exception( | |
'Did you forget to include {} in your index string ?'.format( | |
', '.join('{%' + x + '%}' for x in missing) | |
) | |
) |
Lines 409 to 415 in 54ca4a3
plural = 's' if len(missing) > 1 else '' | |
raise Exception( | |
'Missing element{pl} {ids} in index.'.format( | |
ids=', '.join(missing), | |
pl=plural | |
) | |
) |
A new exception type DependencyException
:
Lines 357 to 374 in 54ca4a3
if package_name not in self.registered_paths: | |
raise Exception( | |
'Error loading dependency.\n' | |
'"{}" is not a registered library.\n' | |
'Registered libraries are: {}' | |
.format(package_name, list(self.registered_paths.keys()))) | |
elif path_in_package_dist not in self.registered_paths[package_name]: | |
raise Exception( | |
'"{}" is registered but the path requested is not valid.\n' | |
'The path requested: "{}"\n' | |
'List of registered paths: {}' | |
.format( | |
package_name, | |
path_in_package_dist, | |
self.registered_paths | |
) | |
) |
ResourceException
?:
Lines 42 to 48 in 54ca4a3
raise Exception( | |
'{} does not have a ' | |
'relative_package_path, absolute_path, or an ' | |
'external_url.'.format( | |
json.dumps(filtered_resource) | |
) | |
) |
Metadata
Metadata
Assignees
Labels
featuresomething newsomething new