lib/skylight/messages/trace.rb in skylight-0.1.5 vs lib/skylight/messages/trace.rb in skylight-0.1.6.alpha1
- old
+ new
@@ -109,12 +109,18 @@
nil
end
def build
return if @busted
- raise TraceError, "trace unbalanced" unless @stack.empty?
+ unless @stack.empty?
+ remaining = @stack.map do |sp|
+ sp == :skip ? :skip : sp.category
+ end
+ raise TraceError, "trace unbalanced; remaining=#{remaining.inspect}"
+ end
+
Trace.new(
uuid: 'TODO',
endpoint: endpoint,
spans: spans)
end
@@ -139,10 +145,10 @@
end
def pop
unless sp = @stack.pop
@busted = true
- raise TraceError, "trace unbalanced"
+ raise TraceError, "closing span -- trace unbalanced"
end
@parents.pop if :skip != sp
sp