From bdd4170519a0bc5bbc9379389651c983c7be7978 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Tue, 19 Dec 2017 21:56:28 -0500 Subject: [PATCH] Signify error code 104 as an AuthenticationError Error code 104 represents: `Incorrect signature`, with a type of `OAuthException` Reference: https://developers.facebook.com/docs/marketing-api/error-reference --- lib/koala/api/graph_error_checker.rb | 2 +- spec/cases/graph_error_checker_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/koala/api/graph_error_checker.rb b/lib/koala/api/graph_error_checker.rb index 44f0328e..df39fc5b 100644 --- a/lib/koala/api/graph_error_checker.rb +++ b/lib/koala/api/graph_error_checker.rb @@ -13,7 +13,7 @@ def initialize(http_status, body, headers) # Facebook has a set of standardized error codes, some of which represent problems with the # token. - AUTHENTICATION_ERROR_CODES = [102, 190, 450, 452, 2500] + AUTHENTICATION_ERROR_CODES = [102, 190, 450, 452, 2500, 104].freeze # Facebook can return debug information in the response headers -- see # https://developers.facebook.com/docs/graph-api/using-graph-api#bugdebug diff --git a/spec/cases/graph_error_checker_spec.rb b/spec/cases/graph_error_checker_spec.rb index d57ef6e7..41fad4d6 100644 --- a/spec/cases/graph_error_checker_spec.rb +++ b/spec/cases/graph_error_checker_spec.rb @@ -4,7 +4,7 @@ module Koala module Facebook RSpec.describe GraphErrorChecker do it "defines a set of AUTHENTICATION_ERROR_CODES" do - expect(GraphErrorChecker::AUTHENTICATION_ERROR_CODES).to match_array([102, 190, 450, 452, 2500]) + expect(GraphErrorChecker::AUTHENTICATION_ERROR_CODES).to match_array([102, 190, 450, 452, 2500, 104]) end it "defines a set of DEBUG_HEADERS" do