File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,14 @@ module ApolloFederation
44 module Tracing
55 KEY = :ftv1
66 DEBUG_KEY = "#{ KEY } _debug" . to_sym
7+ class NotInstalledError < StandardError
8+ MESSAGE = 'Apollo Federation Tracing not installed. \
9+ Add `use ApolloFederation::Tracing` to your schema.'
10+
11+ def message
12+ MESSAGE
13+ end
14+ end
715
816 module_function
917
@@ -19,10 +27,7 @@ def attach_trace_to_result(result)
1927 return result unless result . context [ :tracing_enabled ]
2028
2129 trace = result . context . namespace ( KEY )
22- unless trace [ :start_time ]
23- raise StandardError . new , 'Apollo Federation Tracing not installed. \
24- Add `use ApollFederation::Tracing` to your schema.'
25- end
30+ raise NotInstalledError unless trace [ :start_time ]
2631
2732 result [ 'errors' ] &.each do |error |
2833 trace [ :node_map ] . add_error ( error )
You can’t perform that action at this time.
0 commit comments