-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
97 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module Lotus | ||
module View | ||
# @since x.x.x | ||
class Error < ::StandardError | ||
end | ||
|
||
# Missing template error | ||
# | ||
# This is raised at the runtime when Lotus::View cannot find a template for | ||
# the requested format. | ||
# | ||
# We can't raise this error during the loading phase, because at that time | ||
# we don't know if a view implements its own rendering policy. | ||
# A view is allowed to override `#render`, and this scenario can make the | ||
# presence of a template useless. One typical example is the usage of a | ||
# serializer that returns the output string, without rendering a template. | ||
# | ||
# @since 0.1.0 | ||
class MissingTemplateError < Error | ||
def initialize(template, format) | ||
super("Can't find template '#{ template }' for '#{ format }' format.") | ||
end | ||
end | ||
|
||
# Missing format error | ||
# | ||
# This is raised at the runtime when rendering context lacks of the :format | ||
# key. | ||
# | ||
# @since 0.1.0 | ||
# | ||
# @see Lotus::View::Rendering#render | ||
class MissingFormatError < Error | ||
end | ||
|
||
# Missing template layout error | ||
# | ||
# This is raised at the runtime when Lotus::Layout cannot find it's template. | ||
# | ||
# @since x.x.x | ||
class MissingTemplateLayoutError < Error | ||
def initialize(template) | ||
super("Can't find layout template '#{ template }'") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters