Skip to content

Commit

Permalink
fix: show JSON view when *any* error occurs creating the HTML view fo…
Browse files Browse the repository at this point in the history
…r a pact.
  • Loading branch information
bethesque committed Apr 5, 2018
1 parent 0eb18f0 commit e4342f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pact_broker/api/renderers/html_pact_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def tags

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

0 comments on commit e4342f0

Please sign in to comment.