From 99f9523681ac9c3aa9bd90d94eb7a4940beb46f4 Mon Sep 17 00:00:00 2001 From: Ben Chauvette Date: Wed, 2 Oct 2024 01:06:09 -0400 Subject: [PATCH] fix error codes - remove stale imports - update class references --- lib/open_feature/flagsmith/provider.rb | 2 -- .../provider/refinements/error_refinements.rb | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/open_feature/flagsmith/provider.rb b/lib/open_feature/flagsmith/provider.rb index 818949a..8aa8122 100644 --- a/lib/open_feature/flagsmith/provider.rb +++ b/lib/open_feature/flagsmith/provider.rb @@ -4,9 +4,7 @@ require "open_feature/sdk/provider" require "open_feature/flagsmith/provider/error" -require "open_feature/flagsmith/provider/error_code" require "open_feature/flagsmith/provider/flag_fetcher" -require "open_feature/flagsmith/provider/reason" require "open_feature/flagsmith/provider/resolver" require "open_feature/flagsmith/provider/value_processors" require "open_feature/flagsmith/provider/version" diff --git a/lib/open_feature/flagsmith/provider/refinements/error_refinements.rb b/lib/open_feature/flagsmith/provider/refinements/error_refinements.rb index 057e903..e2a6b2e 100644 --- a/lib/open_feature/flagsmith/provider/refinements/error_refinements.rb +++ b/lib/open_feature/flagsmith/provider/refinements/error_refinements.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "open_feature/flagsmith/provider/error_code" +require "open_feature/sdk/provider/error_code" require "flagsmith/sdk/errors" require "flagsmith/sdk/models/flags" @@ -14,31 +14,31 @@ module Refinements module ErrorRefinements refine ::StandardError do def open_feature_error_code - ErrorCode::GENERAL + SDK::Provider::ErrorCode::GENERAL end end refine ::Flagsmith::Flags::NotFound do def open_feature_error_code - ErrorCode::FLAG_NOT_FOUND + SDK::Provider::ErrorCode::FLAG_NOT_FOUND end end refine ::Flagsmith::FeatureStateNotFound do def open_feature_error_code - ErrorCode::FLAG_NOT_FOUND + SDK::Provider::ErrorCode::FLAG_NOT_FOUND end end refine ::Flagsmith::ClientError do def open_feature_error_code - ErrorCode::FLAGSMITH_CLIENT_ERROR + SDK::Provider::ErrorCode::FLAGSMITH_CLIENT_ERROR end end refine ::Flagsmith::APIError do def open_feature_error_code - ErrorCode::FLAGSMITH_API_ERROR + SDK::Provider::ErrorCode::FLAGSMITH_API_ERROR end end end