refactor DependencyError

This needs an `end`