Skip to content

Commit

Permalink
errors descriptions update
Browse files Browse the repository at this point in the history
  • Loading branch information
usarise committed Jul 15, 2024
1 parent c657ece commit b866973
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Error/Description.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ final class Description {
public const TEXTS = [
'missing-input-secret' => 'The secret parameter was not passed',
'invalid-input-secret' => 'The secret parameter was invalid or did not exist',
'missing-input-response' => 'The response parameter was not passed',
'invalid-input-response' => 'The response parameter is invalid or has expired',
'missing-input-response' => 'The response parameter (token) was not passed',
'invalid-input-response' => 'The response parameter (token) is invalid or has expired. Most of the time, this means a fake token has been used. If the error persists, contact customer support',
'invalid-widget-id' => 'The widget ID extracted from the parsed site secret key was invalid or did not exist',
'invalid-parsed-secret' => 'The secret extracted from the parsed site secret key was invalid',
'bad-request' => 'The request was rejected because it was malformed',
'timeout-or-duplicate' => 'The response parameter has already been validated before',
'timeout-or-duplicate' => 'The response parameter (token) has already been validated before. This means that the token was issued five minutes ago and is no longer valid, or it was already redeemed',
'internal-error' => 'An internal error happened while validating the response. The request can be retried',
'challenge-timeout' => 'Challenge timeout',
'hostname-mismatch' => 'Expected hostname did not match',
'action-mismatch' => 'Expected action did not match',
'cdata-mismatch' => 'Expected cdata did not match',
'invalid-json' => 'Invalid JSON received',
'unknown-error' => 'Not a success, but no error codes received!',
'unknown-error' => 'Not a success, but no error codes received',
];
}
8 changes: 4 additions & 4 deletions tests/ErrorCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ public function testToDescriptionFull(): void {
[
'The secret parameter was not passed',
'The secret parameter was invalid or did not exist',
'The response parameter was not passed',
'The response parameter is invalid or has expired',
'The response parameter (token) was not passed',
'The response parameter (token) is invalid or has expired. Most of the time, this means a fake token has been used. If the error persists, contact customer support',
'The widget ID extracted from the parsed site secret key was invalid or did not exist',
'The secret extracted from the parsed site secret key was invalid',
'The request was rejected because it was malformed',
'The response parameter has already been validated before',
'The response parameter (token) has already been validated before. This means that the token was issued five minutes ago and is no longer valid, or it was already redeemed',
'An internal error happened while validating the response. The request can be retried',
'Challenge timeout',
'Expected hostname did not match',
'Expected action did not match',
'Expected cdata did not match',
'Invalid JSON received',
'Not a success, but no error codes received!',
'Not a success, but no error codes received',
],
ErrorCode::toDescription(
[
Expand Down

0 comments on commit b866973

Please sign in to comment.