Provide insight when encountering `LoadError` and `NameError` during boot #224

bryanp opened this Issue Feb 14, 2017 · 0 comments


None yet
1 participant

bryanp commented Feb 14, 2017

Issue #220 discusses the new loader pattern that we'll follow in 1.0. As part of this change, we want to try and help the developer resolve boot errors caused by missing dependencies.

For example, say we have two mappers:

# app/lib/mappers/foo.rb
class Foo < Bar

# app/lib/models/bar.rb
class Bar < Pakyow::Mapper

The mapper loader will attempt to load foo.rb first, causing a NameError because Bar is not yet defined. We want to tell the developer how they could resolve this, ideally giving them the file path they should require in foo.rb to resolve the error.

Similarly, requiring the wrong path to bar in foo.rb would cause a LoadError. Ideally, we can tell the developer what to change the require path to in order to resolve the error.

This is considered low priority for the 1.0 release, but I would like to include it if it doesn't turn into a nightmare implementation. Errors are frustrating, and we want to help the developer out if we can.

@bryanp bryanp added the enhancement label Feb 14, 2017

@bryanp bryanp added this to the 1.0 milestone Feb 14, 2017

@bryanp bryanp removed the enhancement label May 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment