Skip to content

Commit 42f8ca5

Browse files
committed
Show full response on error
1 parent bb11acc commit 42f8ca5

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

examples/recaptcha-v2-checkbox-explicit.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,7 @@
9999
// If it's not successful, then one or more error codes will be returned.
100100
?>
101101
<h2>Something went wrong</h2>
102-
<p>The following error was returned:
103-
<?php
104-
foreach ($resp->getErrorCodes() as $code) {
105-
echo '<kbd>', $code, '</kbd> ';
106-
}
107-
?></p>
102+
<kbd><pre><?php var_export($resp);?></pre></kbd>
108103
<p>Check the error code reference at <kbd><a href="https://developers.google.com/recaptcha/docs/verify#error-code-reference">https://developers.google.com/recaptcha/docs/verify#error-code-reference</a></kbd>.
109104
<p><strong>Note:</strong> Error code <kbd>missing-input-response</kbd> may mean the user just didn't complete the reCAPTCHA.</p>
110105
<p><a href="/recaptcha-v2-checkbox-explicit.php">⟳ Try again</a></p>

examples/recaptcha-v2-checkbox.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,7 @@
9999
// If it's not successful, then one or more error codes will be returned.
100100
?>
101101
<h2>Something went wrong</h2>
102-
<p>The following error was returned:
103-
<?php
104-
foreach ($resp->getErrorCodes() as $code) {
105-
echo '<kbd>', $code, '</kbd> ';
106-
}
107-
?></p>
102+
<kbd><pre><?php var_export($resp);?></pre></kbd>
108103
<p>Check the error code reference at <kbd><a href="https://developers.google.com/recaptcha/docs/verify#error-code-reference">https://developers.google.com/recaptcha/docs/verify#error-code-reference</a></kbd>.
109104
<p><strong>Note:</strong> Error code <kbd>missing-input-response</kbd> may mean the user just didn't complete the reCAPTCHA.</p>
110105
<p><a href="/recaptcha-v2-checkbox.php">⟳ Try again</a></p>

examples/recaptcha-v2-invisible.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,7 @@
9999
// If it's not successful, then one or more error codes will be returned.
100100
?>
101101
<h2>Something went wrong</h2>
102-
<p>The following error was returned:
103-
<?php
104-
foreach ($resp->getErrorCodes() as $code) {
105-
echo '<kbd>', $code, '</kbd> ';
106-
}
107-
?></p>
102+
<kbd><pre><?php var_export($resp);?></pre></kbd>
108103
<p>Check the error code reference at <kbd><a href="https://developers.google.com/recaptcha/docs/verify#error-code-reference">https://developers.google.com/recaptcha/docs/verify#error-code-reference</a></kbd>.
109104
<p><strong>Note:</strong> Error code <kbd>missing-input-response</kbd> may mean the user just didn't complete the reCAPTCHA.</p>
110105
<p><a href="/recaptcha-v2-invisible.php">⟳ Try again</a></p>

0 commit comments

Comments
 (0)