Skip to content

Commit 86c3b2a

Browse files
committed
display exceptions in the demo page
1 parent e6765b0 commit 86c3b2a

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

demo/index.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,7 @@ function printCode($code, $asHtml = true)
224224
<section>
225225
<h1>Result:</h1>
226226

227-
<?php
228-
try {
229-
$info = Embed\Embed::create(getUrl(), $options);
230-
} catch (Exception $exception) {
231-
echo '<p>'.$exception->getMessage().'</p>';
232-
echo '</section>';
233-
echo '</body>';
234-
echo '</html>';
235-
die();
236-
}
237-
?>
227+
<?php $info = Embed\Embed::create(getUrl(), $options); ?>
238228

239229
<table>
240230
<?php foreach ($adapterData as $name => $fn): ?>

src/Embed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ private static function process(Url $url, array $config, DispatcherInterface $di
7575
return new Adapters\Webpage($response, $config, $dispatcher);
7676
}
7777

78-
throw new Exceptions\InvalidUrlException(sprintf("Invalid url '%s'", (string) $url));
78+
throw new Exceptions\InvalidUrlException(sprintf("Invalid url '%s' (%s)", (string) $url, $response->getStatusCode()));
7979
}
8080
}

0 commit comments

Comments
 (0)