Skip to content

Commit e4342f0

Browse files
committed
fix: show JSON view when *any* error occurs creating the HTML view for a pact.
1 parent 0eb18f0 commit e4342f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/pact_broker/api/renderers/html_pact_renderer.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ def tags
145145

146146
def markdown
147147
Pact::Doc::Markdown::ConsumerContractRenderer.call consumer_contract
148-
rescue NotAPactError
148+
rescue StandardError
149149
heading = "### A contract between #{@pact.consumer.name} and #{@pact.provider.name}"
150-
warning = "_Note: this contract could not be parsed to a Pact, showing raw content instead._"
150+
warning = "_Note: this contract could not be parsed to a v1 or v2 Pact, showing raw content instead._"
151151
pretty_json = JSON.pretty_generate(@pact.content_hash)
152152
"#{heading}\n#{warning}\n```json\n#{pretty_json}\n```\n"
153153
end

0 commit comments

Comments
 (0)