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: typo in exception message #33

Merged
merged 2 commits into from
Oct 21, 2019
Merged
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
13 changes: 9 additions & 4 deletions lib/apollo-federation/tracing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ module ApolloFederation
module Tracing
KEY = :ftv1
DEBUG_KEY = "#{KEY}_debug".to_sym
class NotInstalledError < StandardError
MESSAGE = 'Apollo Federation Tracing not installed. \
Add `use ApolloFederation::Tracing` to your schema.'

def message
MESSAGE
end
end

module_function

Expand All @@ -19,10 +27,7 @@ def attach_trace_to_result(result)
return result unless result.context[:tracing_enabled]

trace = result.context.namespace(KEY)
unless trace[:start_time]
raise StandardError.new, 'Apollo Federation Tracing not installed. \
Add `use ApollFederation::Tracing` to your schema.'
end
raise NotInstalledError unless trace[:start_time]

result['errors']&.each do |error|
trace[:node_map].add_error(error)
Expand Down