Skip to content

Commit

Permalink
fix(gallagher): don't fail if doors endpoint unavaialble
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Sep 23, 2023
1 parent 31481a3 commit 7c4ce84
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/gallagher/rest_api.cr
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ class Gallagher::RestAPI < PlaceOS::Driver
@divisions_endpoint = @cardholders_endpoint.sub("cardholders", "divisions")
@access_groups_endpoint = get_path payload["features"]["accessGroups"]["accessGroups"]["href"].as_s
@events_endpoint = get_path payload["features"]["events"]["events"]["href"].as_s
@doors_endpoint = get_path payload["features"]["doors"]["doors"]["href"].as_s

# not sure what version of Gallagher this was added
begin
@doors_endpoint = get_path payload["features"]["doors"]["doors"]["href"].as_s
rescue error
logger.debug(exception: error) { "error locating doors feature URI" }
end

if api_version >= SemanticVersion.parse("8.10.0")
@card_types_endpoint = get_path payload["features"]["cardTypes"]["assign"]["href"].as_s
Expand Down

0 comments on commit 7c4ce84

Please sign in to comment.