Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subclass errors from a general Lotus module error #82

Merged
merged 6 commits into from
Nov 3, 2015
Merged

Subclass errors from a general Lotus module error #82

merged 6 commits into from
Nov 3, 2015

Conversation

liamdawson
Copy link

Closes #81

@jodosha
Copy link
Member

jodosha commented Oct 31, 2015

@liamdawson Hello, and thanks for this contribution. Can you please name it Error, instead of ViewError? Thanks! 👍

@jodosha jodosha self-assigned this Oct 31, 2015
@jodosha jodosha added this to the v0.6.0 milestone Oct 31, 2015
module Lotus
module View
class ViewError < ::StandardError
def intialize(message)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add that constructor

@liamdawson
Copy link
Author

@jodosha and @pascalbetz — made your suggested adjustments.

@@ -9,7 +10,7 @@ module Rendering
# This is raised at the runtime when Lotus::Layout cannot find it's template.
#
# @since 0.3.0
class MissingTemplateLayoutError < ::StandardError
class MissingTemplateLayoutError < Lotus::View::Error

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought: is there something like a search path in lotus or what extensions were searched? Then this would be useful information in the exception message.

@jodosha
Copy link
Member

jodosha commented Nov 3, 2015

@liamdawson Thank you, merging this. 👍

jodosha added a commit that referenced this pull request Nov 3, 2015
Subclass errors from a general Lotus module error
@jodosha jodosha merged commit 060861d into hanami:master Nov 3, 2015
jodosha added a commit that referenced this pull request Nov 3, 2015
@jodosha
Copy link
Member

jodosha commented Nov 3, 2015

@liamdawson I've cleaned your PR with 847b7da, because MissingTemplateError and MissingFormatError were still inheriting from ::StandardError.

I also moved all the errors in one file (lib/lotus/view/errors.rb) in order to don't require lotus/view/error everywhere, and because I wanted to put all the errors on the same namespace depth. For instance, the commit changes Lotus::View::Rendering::MissingTemplateLayoutError into Lotus::View::MissingTemplateLayoutError.

Can you please follow the same approach for the other frameworks? Thank you very much. ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants