Add own exceptions to the library
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the exception sites named in \SAML2\SOAP::receive() and \SAML2\Binding::getCurrentBinding(), then inspect the library's other simple exceptions. Define the custom exception scope and how exceptions from SimpleSAMLphp should move into this library. Done means the relevant errors use specific exceptions that callers can capture and present with meaningful, translated messages.
Written by the indexing model from the issue text.
Description
While trying to add more meaningful messages to some of the typical errors, I've noticed that at some points in the library we are throwing simple exceptions with a message that's not really descriptive of the real problem, nor even translated. For instance, in \SAML2\SOAP::receive():
$postText = file_get_contents('php://input');
if (empty($postText)) {
throw new Exception('Invalid message received to AssertionConsumerService endpoint.');
}
or in \SAML2\Binding::getCurrentBinding():
throw new Exception('Unable to find the current binding.');
If these were custom exceptions, we could capture them easily and display a meaningful, translated error message to the user, depending on where we are. Therefore I think we should even move some of the exceptions in SimpleSAMLphp to this library, and extend them with specific ones.
- Dominant language
- PHP
- Stars
- 306
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simplesamlphp/saml2
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
simplesamlphp/saml2#408 · 4 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
simplesamlphp/saml2#397 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
simplesamlphp/saml2#360 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
simplesamlphp/saml2#345 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
simplesamlphp/saml2#309 · 18 comments ·
All issues in simplesamlphp/saml2
Similar issues
-
Solved site promotion gate fails on runner PHP patch drift (expects 8.2.33, runner installs 8.2.34) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#2161 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/static-site-importer#1824 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
0. Needs triage 35-feedback bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100