Skip to content

Commit 697d759

Browse files
committed
[-] Error Handling - Display an explicit error message if the envSecret is detected as missing or unknown during data a API request
1 parent 4347cba commit 697d759

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Change Log
22

33
## [Unreleased]
4+
### Changed
5+
- Error Handling - Display an explicit error message if the envSecret is detected as missing or unknown during data a API request.
46

57
## RELEASE 3.0.0-beta.16 - 2019-03-29
68
### Fixed

app/controllers/forest_liana/base_controller.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def reject_unauthorized_ip
2020
end
2121
end
2222
rescue ForestLiana::Errors::ExpectedError => exception
23-
exception.display_error
2423
error_data = JSONAPI::Serializer.serialize_errors([{
2524
status: exception.error_code,
2625
detail: exception.message

app/services/forest_liana/ip_whitelist.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ def self.retrieve
1515
@@ip_whitelist_rules = ip_whitelist_data['rules']
1616
true
1717
else
18-
raise "Cannot retrieve the data from the Forest server. Forest API returned an #{Errors::HTTPErrorHelper.format(response)}"
18+
FOREST_LOGGER.error 'An error occured while retrieving your IP whitelist. Your Forest ' +
19+
'env_secret seems to be missing or unknown. Can you check that you properly set your ' +
20+
'Forest env_secret in the forest_liana initializer?'
21+
false
1922
end
2023
rescue => exception
2124
FOREST_LOGGER.error 'Cannot retrieve the IP Whitelist from the Forest server.'

0 commit comments

Comments
 (0)