From e4342f0fc835abebe31aaedba2f8d4b6494614a0 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 5 Apr 2018 10:40:30 +1000 Subject: [PATCH] fix: show JSON view when *any* error occurs creating the HTML view for a pact. --- lib/pact_broker/api/renderers/html_pact_renderer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pact_broker/api/renderers/html_pact_renderer.rb b/lib/pact_broker/api/renderers/html_pact_renderer.rb index dd08bf50a..011f0a149 100644 --- a/lib/pact_broker/api/renderers/html_pact_renderer.rb +++ b/lib/pact_broker/api/renderers/html_pact_renderer.rb @@ -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