Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error codes #5

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/open_feature/flagsmith/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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
Expand Down