Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge commit '6997b1bae6187937a2fc2eb7e0126c71a866e414' into HEAD

  • Loading branch information...
commit 2dec6e4b43c10ec907a2a01dfe37c2a7dd9a7bab 2 parents 54e3a13 + 6997b1b
Jenkins authored
Showing with 4 additions and 33 deletions.
  1. +4 −13 lib/app.rb
  2. +0 −17 lib/views/error_page.erb
  3. +0 −3  lib/views/fail.erb
View
17 lib/app.rb
@@ -17,10 +17,6 @@ class App < Sinatra::Base
before do
@client = ZendeskClient.get_client(logger)
-
- #if @client.current_user["id"].nil?
- # raise ZendeskError.new("Authentication error", "Check logs for details")
- #end
end
get '/' do
@@ -31,10 +27,6 @@ class App < Sinatra::Base
erb :acknowledge
end
- get '/failed-submission' do
- erb :fail
- end
-
#Content routing
get '/amend-content' do
on_get("Content Change", "content/content_amend_message", "content/amend")
@@ -89,7 +81,7 @@ class App < Sinatra::Base
on_post(params, "reset-password")
end
-# Campaigns routing
+ #Campaigns routing
get '/campaign' do
on_get("Campaign", "campaigns/campaign_message", "campaigns/campaign")
end
@@ -151,7 +143,7 @@ def on_post(params, route)
redirect '/acknowledge'
else
ExceptionMailer.deliver_exception_notification(env['sinatra.error'])
- redirect '/failed-submission'
+ 500
end
else
erb :"#{@template}", :layout => :formlayout
@@ -160,15 +152,14 @@ def on_post(params, route)
error do
ExceptionMailer.deliver_exception_notification(env['sinatra.error'])
- @error_msg = request.env['sinatra.error']
- erb :error_page
+ 500
end
error ZendeskError do
exception_message = format_exception_message(env['sinatra.error'].message, env['sinatra.error'].details_from_zendesk)
ExceptionMailer.deliver_exception_notification(exception_message)
- redirect "/failed-submission"
+ 401
end
def format_exception_message(message, details)
View
17 lib/views/error_page.erb
@@ -1,17 +0,0 @@
-<div class="inner">
- <header class="content-header group">
- <hgroup><h1>Welcome To GovUK Support</h1></hgroup>
- </header>
-
- <%= erb :menu %>
-
- <div id="form">
- <p class="error">
- There has been a problem
- </p>
- <p>
- <%= @error_msg %>
- </p>
- </div>
- <div class="toclear"></div>
-</div>
View
3  lib/views/fail.erb
@@ -1,3 +0,0 @@
-<header class="content-header group">
- <hgroup><h1 style="height: 500px">We're unable to submit your request at this time. Please try again later.</h1></hgroup>
-</header>
Please sign in to comment.
Something went wrong with that request. Please try again.