GRN2-192: Made error pages more descriptive (#620)

* GRN2-192

* Brought back error codes
This commit is contained in:
farhatahmad
2019-07-10 11:51:19 -04:00
committed by Jesus Federico
parent 523d9a38f2
commit c7a0c6a463
11 changed files with 38 additions and 56 deletions

View File

@ -141,7 +141,11 @@ class ApplicationController < ActionController::Base
retrieve_provider_info(@user_domain, 'api2', 'getUserGreenlightCredentials')
rescue => e
if e.message.eql? "No user with that id exists"
render "errors/not_found", locals: { user_not_found: true }
render "errors/not_found", locals: { message: I18n.t("errors.not_found.user_not_found.message"),
help: I18n.t("errors.not_found.user_not_found.help") }
elsif e.message.eql? "Provider not included."
render "errors/not_found", locals: { message: I18n.t("errors.not_found.user_missing.message"),
help: I18n.t("errors.not_found.user_missing.help") }
else
render "errors/internal_error"
end

View File

@ -21,10 +21,6 @@ class ErrorsController < ApplicationController
render status: 404, formats: :html
end
def unprocessable
render status: 422, formats: :html
end
def internal_error
render status: 500, formats: :html
end