forked from gsamokovarov/web-console
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from sh19910711/patch/0020/show-error-message
Show an error message when an error response does not have JSON
- Loading branch information
Showing
11 changed files
with
114 additions
and
57 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,15 @@ | ||
en: | ||
errors: | ||
unavailable_session: | | ||
Session %{id} is is no longer available in memory. | ||
If you happen to run on a multi-process server (like Unicorn or Puma) the process | ||
this request hit doesn't store %{id} in memory. Consider turning the number of | ||
processes/workers to one (1) or using a different server in development. | ||
unacceptable_request: | | ||
A supported version is expected in the Accept header. | ||
connection_refused: | | ||
Oops! Failed to connect to the Web Console middleware. | ||
Please make sure a rails development server is running. |
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
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,33 @@ | ||
module WebConsole | ||
class View < ActionView::Base | ||
# Execute a block only on error pages. | ||
# | ||
# The error pages are special, because they are the only pages that | ||
# currently require multiple bindings. We get those from exceptions. | ||
def only_on_error_page(*args) | ||
yield if @env['web_console.exception'].present? | ||
end | ||
|
||
# Render JavaScript inside a script tag and a closure. | ||
# | ||
# This one lets write JavaScript that will automatically get wrapped in a | ||
# script tag and enclosed in a closure, so you don't have to worry for | ||
# leaking globals, unless you explicitly want to. | ||
def render_javascript(template) | ||
render(template: template, layout: 'layouts/javascript') | ||
end | ||
|
||
# Render inlined string to be used inside of JavaScript code. | ||
# | ||
# The inlined string is returned as an actual JavaScript string. You | ||
# don't need to wrap the result yourself. | ||
def render_inlined_string(template) | ||
render(template: template, layout: 'layouts/inlined_string') | ||
end | ||
|
||
# Escaped alias for "ActionView::Helpers::TranslationHelper.t". | ||
def t(key, options = {}) | ||
super.gsub("\n", "\\n") | ||
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